Skip to content

Commit

Permalink
Change: Rename GMP 21.10 to GMP 22.04 [#691]
Browse files Browse the repository at this point in the history
Rename GMP 21.10 to GMP 22.04
  • Loading branch information
y0urself authored Mar 2, 2022
2 parents 5839aaf + 3621bfc commit f5ef767
Show file tree
Hide file tree
Showing 89 changed files with 382 additions and 408 deletions.
6 changes: 3 additions & 3 deletions gvm/protocols/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@
Package for supported Greenbone Protocol versions.
Currently `GMP version 20.08`_, `GMP version 21.04`_
and `OSP version 1`_ are supported.
`GMP version 22.04` and `OSP version 1`_ are supported.
.. _GMP version 20.08:
https://docs.greenbone.net/API/GMP/gmp-20.08.html
.. _GMP version 21.04:
https://docs.greenbone.net/API/GMP/gmp-21.04.html
.. _GMP version 21.10:
https://docs.greenbone.net/API/GMP/gmp-21.10.html
.. _GMP version 22.04:
https://docs.greenbone.net/API/GMP/gmp-22.04.html
.. _OSP version 1:
https://docs.greenbone.net/API/OSP/osp-1.2.html
"""
10 changes: 6 additions & 4 deletions gvm/protocols/gmp.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,15 @@

from gvm.protocols.gmpv208 import Gmp as Gmpv208
from gvm.protocols.gmpv214 import Gmp as Gmpv214
from gvm.protocols.gmpv2110 import Gmp as Gmpv2110
from gvm.protocols.gmpv224 import Gmp as Gmpv224

from gvm.transforms import EtreeCheckCommandTransform

from gvm.xml import XmlCommand

SUPPORTED_GMP_VERSIONS = Union[Gmpv208, Gmpv214] # pylint: disable=invalid-name
SUPPORTED_GMP_VERSIONS = Union[ # pylint: disable=invalid-name
Gmpv208, Gmpv214, Gmpv224
]


class Gmp(GvmProtocol):
Expand Down Expand Up @@ -104,8 +106,8 @@ def determine_supported_gmp(self) -> SUPPORTED_GMP_VERSIONS:
gmp_class = Gmpv208
elif major_version == 21 and minor_version == 4:
gmp_class = Gmpv214
elif major_version == 21 and minor_version == 10:
gmp_class = Gmpv2110
elif major_version == 22 and minor_version == 4:
gmp_class = Gmpv224
else:
raise GvmError(
'Remote manager daemon uses an unsupported version of GMP. '
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@

"""
Module for communication with gvmd in
`Greenbone Management Protocol version 21.10`_
`Greenbone Management Protocol version 22.04`_
.. _Greenbone Management Protocol version 21.10:
https://docs.greenbone.net/API/GMP/gmp-21.10.html
.. _Greenbone Management Protocol version 22.04:
https://docs.greenbone.net/API/GMP/gmp-22.04.html
"""

import logging
Expand Down Expand Up @@ -128,10 +128,10 @@
TargetsMixin,
)

# NEW IN 2110
from gvm.protocols.gmpv2110.entities.users import UsersMixin
# NEW IN 224
from gvm.protocols.gmpv224.entities.users import UsersMixin

from gvm.protocols.gmpv2110.system.version import VersionMixin
from gvm.protocols.gmpv224.system.version import VersionMixin

from gvm.connections import GvmConnection

Expand Down Expand Up @@ -204,7 +204,7 @@ class Gmp(
):
"""Python interface for Greenbone Management Protocol
This class implements the `Greenbone Management Protocol version 21.10`_
This class implements the `Greenbone Management Protocol version 22.04`_
Arguments:
connection: Connection to use to talk with the gvmd daemon. See
Expand All @@ -216,8 +216,8 @@ class Gmp(
See :mod:`gvm.transforms` for existing transforms.
.. _Greenbone Management Protocol version 21.10:
https://docs.greenbone.net/API/GMP/gmp-21.10.html
.. _Greenbone Management Protocol version 22.04:
https://docs.greenbone.net/API/GMP/gmp-22.04.html
.. _callable:
https://docs.python.org/3/library/functions.html#callable
"""
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
VersionMixin as Gmp208VersionMixin,
)

PROTOCOL_VERSION = (21, 10)
PROTOCOL_VERSION = (22, 4)


class VersionMixin(Gmp208VersionMixin):
Expand Down
4 changes: 2 additions & 2 deletions gvm/protocols/next.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,14 @@
:py:mod:`gvm.protocols`.
Exports:
- :py:class:`gvm.protocols.gmpv2110.Gmp`
- :py:class:`gvm.protocols.gmpv224.Gmp`
- :py:class:`gvm.protocols.ospv1.Osp`
.. _Greenbone Management Protocol:
https://docs.greenbone.net/API/GMP/gmp.html
"""

from .gmpv2110 import (
from .gmpv224 import (
Gmp,
AggregateStatistic,
AlertCondition,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.


from gvm.protocols.gmpv2110 import Gmp
from gvm.protocols.gmpv224 import Gmp

from .. import GmpTestCase


class Gmpv2110TestCase(GmpTestCase):
class Gmpv224TestCase(GmpTestCase):

gmp_class = Gmp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

from gvm.errors import RequiredArgument

from gvm.protocols.gmpv2110 import SeverityLevel
from gvm.protocols.gmpv224 import SeverityLevel


class GmpCreateNoteTestMixin:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

from gvm.errors import RequiredArgument

from gvm.protocols.gmpv2110 import SeverityLevel
from gvm.protocols.gmpv224 import SeverityLevel


class GmpModifyNoteTestMixin:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

from gvm.errors import RequiredArgument

from gvm.protocols.gmpv2110 import SeverityLevel
from gvm.protocols.gmpv224 import SeverityLevel


class GmpCreateOverrideTestMixin:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

from gvm.errors import RequiredArgument

from gvm.protocols.gmpv2110 import SeverityLevel
from gvm.protocols.gmpv224 import SeverityLevel


class GmpModifyOverrideTestMixin:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

from gvm.errors import RequiredArgument, InvalidArgumentType

from gvm.protocols.gmpv2110 import ScannerType
from gvm.protocols.gmpv224 import ScannerType


class GmpCreateScannerTestMixin:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.

from gvm.errors import RequiredArgument, InvalidArgumentType
from gvm.protocols.gmpv2110 import ScannerType
from gvm.protocols.gmpv224 import ScannerType


class GmpModifyScannerTestMixin:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

from gvm.errors import RequiredArgument, InvalidArgumentType

from gvm.protocols.gmpv2110 import AliveTest
from gvm.protocols.gmpv224 import AliveTest


class GmpCreateTargetTestMixin:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

from ...gmpv2110 import Gmpv2110TestCase
from ...gmpv224 import Gmpv224TestCase
from ...gmpv208.entities.alerts import (
GmpCloneAlertTestMixin,
GmpCreateAlertTestMixin,
Expand All @@ -29,33 +29,33 @@
)


class Gmpv2110CloneAlertTestCase(GmpCloneAlertTestMixin, Gmpv2110TestCase):
class Gmpv224CloneAlertTestCase(GmpCloneAlertTestMixin, Gmpv224TestCase):
pass


class Gmpv2110CreateAlertTestCase(GmpCreateAlertTestMixin, Gmpv2110TestCase):
class Gmpv224CreateAlertTestCase(GmpCreateAlertTestMixin, Gmpv224TestCase):
pass


class Gmpv2110DeleteAlertTestCase(GmpDeleteAlertTestMixin, Gmpv2110TestCase):
class Gmpv224DeleteAlertTestCase(GmpDeleteAlertTestMixin, Gmpv224TestCase):
pass


class Gmpv2110GetAlertTestCase(GmpGetAlertTestMixin, Gmpv2110TestCase):
class Gmpv224GetAlertTestCase(GmpGetAlertTestMixin, Gmpv224TestCase):
pass


class Gmpv2110GetAlertsTestCase(GmpGetAlertsTestMixin, Gmpv2110TestCase):
class Gmpv224GetAlertsTestCase(GmpGetAlertsTestMixin, Gmpv224TestCase):
pass


class Gmpv2110ModifyAlertTestCase(GmpModifyAlertTestMixin, Gmpv2110TestCase):
class Gmpv224ModifyAlertTestCase(GmpModifyAlertTestMixin, Gmpv224TestCase):
pass


class Gmpv2110TestAlertTestCase(GmpTestAlertTestMixin, Gmpv2110TestCase):
class Gmpv224TestAlertTestCase(GmpTestAlertTestMixin, Gmpv224TestCase):
pass


class Gmpv2110TriggerAlertTestCase(GmpTriggerAlertTestMixin, Gmpv2110TestCase):
class Gmpv224TriggerAlertTestCase(GmpTriggerAlertTestMixin, Gmpv224TestCase):
pass
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

from ...gmpv2110 import Gmpv2110TestCase
from ...gmpv224 import Gmpv224TestCase
from ...gmpv208.entities.audits import (
GmpCloneAuditTestMixin,
GmpCreateAuditTestMixin,
Expand All @@ -30,37 +30,37 @@
)


class Gmpv2110CloneAuditTestCase(GmpCloneAuditTestMixin, Gmpv2110TestCase):
class Gmpv224CloneAuditTestCase(GmpCloneAuditTestMixin, Gmpv224TestCase):
pass


class Gmpv2110CreateAuditTestCase(GmpCreateAuditTestMixin, Gmpv2110TestCase):
class Gmpv224CreateAuditTestCase(GmpCreateAuditTestMixin, Gmpv224TestCase):
pass


class Gmpv2110DeleteAuditTestCase(GmpDeleteAuditTestMixin, Gmpv2110TestCase):
class Gmpv224DeleteAuditTestCase(GmpDeleteAuditTestMixin, Gmpv224TestCase):
pass


class Gmpv2110GetAuditTestCase(GmpGetAuditTestMixin, Gmpv2110TestCase):
class Gmpv224GetAuditTestCase(GmpGetAuditTestMixin, Gmpv224TestCase):
pass


class Gmpv2110GetAuditsTestCase(GmpGetAuditsTestMixin, Gmpv2110TestCase):
class Gmpv224GetAuditsTestCase(GmpGetAuditsTestMixin, Gmpv224TestCase):
pass


class Gmpv2110ModifyAuditTestCase(GmpModifyAuditTestMixin, Gmpv2110TestCase):
class Gmpv224ModifyAuditTestCase(GmpModifyAuditTestMixin, Gmpv224TestCase):
pass


class Gmpv2110ResumeAuditTestCase(GmpResumeAuditTestMixin, Gmpv2110TestCase):
class Gmpv224ResumeAuditTestCase(GmpResumeAuditTestMixin, Gmpv224TestCase):
pass


class Gmpv2110StartAuditTestCase(GmpStartAuditTestMixin, Gmpv2110TestCase):
class Gmpv224StartAuditTestCase(GmpStartAuditTestMixin, Gmpv224TestCase):
pass


class Gmpv2110StopAuditTestCase(GmpStopAuditTestMixin, Gmpv2110TestCase):
class Gmpv224StopAuditTestCase(GmpStopAuditTestMixin, Gmpv224TestCase):
pass
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.

from ...gmpv2110 import Gmpv2110TestCase
from ...gmpv224 import Gmpv224TestCase
from ...gmpv208.entities.credentials import (
GmpCloneCredentialTestMixin,
GmpCreateCredentialTestMixin,
Expand All @@ -27,37 +27,35 @@
)


class Gmpv2110CloneCredentialTestCase(
GmpCloneCredentialTestMixin, Gmpv2110TestCase
class Gmpv224CloneCredentialTestCase(
GmpCloneCredentialTestMixin, Gmpv224TestCase
):
pass


class Gmpv2110CreateCredentialTestCase(
GmpCreateCredentialTestMixin, Gmpv2110TestCase
class Gmpv224CreateCredentialTestCase(
GmpCreateCredentialTestMixin, Gmpv224TestCase
):
pass


class Gmpv2110DeleteCredentialTestCase(
GmpDeleteCredentialTestMixin, Gmpv2110TestCase
class Gmpv224DeleteCredentialTestCase(
GmpDeleteCredentialTestMixin, Gmpv224TestCase
):
pass


class Gmpv2110GetCredentialTestCase(
GmpGetCredentialTestMixin, Gmpv2110TestCase
):
class Gmpv224GetCredentialTestCase(GmpGetCredentialTestMixin, Gmpv224TestCase):
pass


class Gmpv2110GetCredentialsTestCase(
GmpGetCredentialsTestMixin, Gmpv2110TestCase
class Gmpv224GetCredentialsTestCase(
GmpGetCredentialsTestMixin, Gmpv224TestCase
):
pass


class Gmpv2110ModifyCredentialTestCase(
GmpModifyCredentialTestMixin, Gmpv2110TestCase
class Gmpv224ModifyCredentialTestCase(
GmpModifyCredentialTestMixin, Gmpv224TestCase
):
pass
Loading

0 comments on commit f5ef767

Please sign in to comment.