Merge pull request #1311 from ogayot/pro-services-auto-enabled
ubuntu-pro: add auto_enabled property for services
This commit is contained in:
commit
7f4a72a12f
|
@ -460,6 +460,7 @@ class UbuntuProCheckTokenStatus(enum.Enum):
|
||||||
class UbuntuProService:
|
class UbuntuProService:
|
||||||
name: str
|
name: str
|
||||||
description: str
|
description: str
|
||||||
|
auto_enabled: bool
|
||||||
|
|
||||||
|
|
||||||
@attr.s(auto_attribs=True)
|
@attr.s(auto_attribs=True)
|
||||||
|
|
|
@ -191,18 +191,22 @@ class TestUAInterface(unittest.TestCase):
|
||||||
self.assertIn(UbuntuProService(
|
self.assertIn(UbuntuProService(
|
||||||
name="esm-infra",
|
name="esm-infra",
|
||||||
description="UA Infra: Extended Security Maintenance (ESM)",
|
description="UA Infra: Extended Security Maintenance (ESM)",
|
||||||
|
auto_enabled=True,
|
||||||
), services)
|
), services)
|
||||||
self.assertIn(UbuntuProService(
|
self.assertIn(UbuntuProService(
|
||||||
name="fips",
|
name="fips",
|
||||||
description="NIST-certified core packages",
|
description="NIST-certified core packages",
|
||||||
|
auto_enabled=False,
|
||||||
), services)
|
), services)
|
||||||
self.assertNotIn(UbuntuProService(
|
self.assertNotIn(UbuntuProService(
|
||||||
name="esm-apps",
|
name="esm-apps",
|
||||||
description="UA Apps: Extended Security Maintenance (ESM)",
|
description="UA Apps: Extended Security Maintenance (ESM)",
|
||||||
|
auto_enabled=True,
|
||||||
), services)
|
), services)
|
||||||
self.assertNotIn(UbuntuProService(
|
self.assertNotIn(UbuntuProService(
|
||||||
name="cis",
|
name="cis",
|
||||||
description="Center for Internet Security Audit Tools",
|
description="Center for Internet Security Audit Tools",
|
||||||
|
auto_enabled=False,
|
||||||
), services)
|
), services)
|
||||||
|
|
||||||
# Test with "Z" suffix for the expiration date.
|
# Test with "Z" suffix for the expiration date.
|
||||||
|
|
|
@ -174,6 +174,7 @@ class UAInterface:
|
||||||
return UbuntuProService(
|
return UbuntuProService(
|
||||||
name=service["name"],
|
name=service["name"],
|
||||||
description=service["description"],
|
description=service["description"],
|
||||||
|
auto_enabled=service["auto_enabled"] == "yes",
|
||||||
)
|
)
|
||||||
|
|
||||||
activable_services: List[UbuntuProService] = []
|
activable_services: List[UbuntuProService] = []
|
||||||
|
|
Loading…
Reference in New Issue