Skip to content

Commit

Permalink
refactor upgrades with feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
SK1Y101 committed Aug 21, 2024
1 parent 4b96bd0 commit 19f2694
Show file tree
Hide file tree
Showing 7 changed files with 207 additions and 209 deletions.
23 changes: 0 additions & 23 deletions anvil-python/anvil/commands/haproxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@

from anvil.jobs.manifest import Manifest
from anvil.jobs.steps import RemoveMachineUnitStep
from anvil.utils import UpgradeCharm

LOG = logging.getLogger(__name__)

Expand Down Expand Up @@ -187,28 +186,6 @@ def get_unit_timeout(self) -> int:
return HAPROXY_UNIT_TIMEOUT


class UpgradeHAProxyUnitCharms(UpgradeCharm):
def __init__(
self,
client: Client,
jhelper: JujuHelper,
manifest: Manifest,
model: str,
):
super().__init__(
"Upgrade HAProxy unit charms",
"Upgrading HAProxy unit charms.",
client,
jhelper,
manifest,
model,
["haproxy", "keepalived"],
"haproxy-plan",
HAPROXY_CONFIG_KEY,
HAPROXY_UNIT_TIMEOUT,
)


def haproxy_install_steps(
client: Client,
manifest: Manifest,
Expand Down
23 changes: 0 additions & 23 deletions anvil-python/anvil/commands/maas_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

from anvil.jobs.manifest import Manifest
from anvil.jobs.steps import RemoveMachineUnitStep
from anvil.utils import UpgradeCharm

APPLICATION = "maas-agent"
CONFIG_KEY = "TerraformVarsMaasagentPlan"
Expand Down Expand Up @@ -112,28 +111,6 @@ def get_unit_timeout(self) -> int:
return MAASAGENT_UNIT_TIMEOUT


class UpgradeMAASAgentUnitCharms(UpgradeCharm):
def __init__(
self,
client: Client,
jhelper: JujuHelper,
manifest: Manifest,
model: str,
):
super().__init__(
"Upgrade MAAS Agent unit charms",
"Upgrading MAAS Agent unit charms.",
client,
jhelper,
manifest,
model,
["maas-agent"],
"maas-agent-plan",
CONFIG_KEY,
MAASAGENT_UNIT_TIMEOUT,
)


def maas_agent_install_steps(
client: Client,
manifest: Manifest,
Expand Down
23 changes: 0 additions & 23 deletions anvil-python/anvil/commands/maas_region.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

from anvil.jobs.manifest import Manifest
from anvil.jobs.steps import RemoveMachineUnitStep
from anvil.utils import UpgradeCharm

APPLICATION = "maas-region"
CONFIG_KEY = "TerraformVarsMaasregionPlan"
Expand Down Expand Up @@ -120,28 +119,6 @@ def get_unit_timeout(self) -> int:
return MAASREGION_UNIT_TIMEOUT


class UpgradeMAASRegionUnitCharms(UpgradeCharm):
def __init__(
self,
client: Client,
jhelper: JujuHelper,
manifest: Manifest,
model: str,
):
super().__init__(
"Upgrade MAAS Region unit charms",
"Upgrading MAAS Region unit charms.",
client,
jhelper,
manifest,
model,
["maas-region", "pgbouncer"],
"maas-region-plan",
CONFIG_KEY,
MAASREGION_UNIT_TIMEOUT,
)


def maas_region_install_steps(
client: Client,
manifest: Manifest,
Expand Down
23 changes: 0 additions & 23 deletions anvil-python/anvil/commands/postgresql.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@

from anvil.jobs.manifest import Manifest
from anvil.jobs.steps import RemoveMachineUnitStep
from anvil.utils import UpgradeCharm

LOG = logging.getLogger(__name__)
APPLICATION = "postgresql"
Expand Down Expand Up @@ -278,25 +277,3 @@ def __init__(

def get_unit_timeout(self) -> int:
return POSTGRESQL_UNIT_TIMEOUT


class UpgradePostgreSQLUnitCharms(UpgradeCharm):
def __init__(
self,
client: Client,
jhelper: JujuHelper,
manifest: Manifest,
model: str,
):
super().__init__(
"Upgrade PostgreSQL unit charms",
"Upgrading PostgreSQL unit charms.",
client,
jhelper,
manifest,
model,
["postgresql"],
"postgresql-plan",
CONFIG_KEY,
POSTGRESQL_UNIT_TIMEOUT,
)
2 changes: 1 addition & 1 deletion anvil-python/anvil/commands/refresh.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
is_flag=True,
show_default=True,
default=False,
help="Upgrade MAAS-Anvil release.",
help="Upgrade MAAS Anvil release.",
)
@click.pass_context
def refresh(
Expand Down
Loading

0 comments on commit 19f2694

Please sign in to comment.