Skip to content

Commit 168e3ac

Browse files
committed
tools/update: change docs to be more consistent
Function `update_all` denoted the wrong intention because we update pools through their master host. Signed-off-by: Olivier Hoareau <olivier.hoareau@vates.tech>
1 parent 211cf8a commit 168e3ac

3 files changed

Lines changed: 21 additions & 14 deletions

File tree

README.md

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -572,12 +572,14 @@ This command performs an update operation on remote targets.
572572
uv run scripts/tools.py update -H primary1 primary2
573573
```
574574

575-
For each primary target :
576-
577-
1. Clean cached metadata
578-
2. Update with repository manager (yum): Optionally enables repositories
579-
3. Reboot
580-
4. Get attached secondary hosts and repeats three previous steps for each secondary
575+
For each pool target :
576+
577+
1. Update primary host of the pool:
578+
* Clean cached metadata
579+
* Update with repository manager (yum): Optionally enables repositories
580+
* Reboot
581+
2. Get attached secondary hosts of the pool
582+
* Repeat step `1.` for each secondary
581583

582584
**Inventory file**
583585

lib/tools/cli.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@
99
from lib.common import HostAddress
1010
from lib.tools import logger
1111
from lib.tools.inventory import into_inventory, load_inventory
12-
from lib.tools.tasks.update import update_all
12+
from lib.tools.tasks.update import update_pools
1313

1414
def _command_update(args):
1515
if args.inventory:
1616
inventory = load_inventory(args.inventory)
1717
else:
1818
inventory = into_inventory(args.hosts, args.repos)
1919

20-
update_all(inventory)
20+
update_pools(inventory)
2121

2222

2323
def cli():
@@ -31,12 +31,17 @@ def cli():
3131
# subparser - command: update
3232
subparser_cmd_update = subparsers.add_parser(
3333
name="update",
34-
description="Run update tasks on target(s)",
35-
help="Run update tasks on target(s)",
34+
description="Run update tasks on target pools",
35+
help="Run update tasks on target pools",
3636
)
3737
cmd_update_excl_grp = subparser_cmd_update.add_mutually_exclusive_group(required=True)
3838
cmd_update_excl_grp.add_argument(
39-
"-H", "--hosts", type=HostAddress, metavar="HOST", nargs="+", help="Hostname(s) or ip address(es) of target(s)"
39+
"-H",
40+
"--hosts",
41+
type=HostAddress,
42+
metavar="HOST",
43+
nargs="+",
44+
help="Address (hostname|ip) of the master host in pool",
4045
)
4146
cmd_update_excl_grp.add_argument("-i", "--inventory", type=Path, help="Use an hosts inventory file")
4247
subparser_cmd_update.add_argument(

lib/tools/tasks/update.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,15 @@
88

99
from .. import logger
1010

11-
def update_all(inventory: dict) -> None:
12-
"""Updates all master (primary) hosts.
11+
def update_pools(inventory: dict) -> None:
12+
"""Updates hosts in pool(s).
1313
1414
.. note:: Host must be a master
1515
1616
Throws error if hosts are not master (primary).
1717
1818
:param dict inventory:
19-
Each host (key) holds its own config data (values).
19+
Each host (key) holds its own config data (values, eg: `enablerepos`).
2020
"""
2121
logger.debug(f"Inventory: {inventory}")
2222
# init related pools

0 commit comments

Comments
 (0)