From 2380ad7cde6c6e2408eda2129d9e89e843f10db0 Mon Sep 17 00:00:00 2001 From: Jake Nabasny Date: Sat, 5 Aug 2023 17:46:42 -0400 Subject: [PATCH] Update command references to juju 3.x syntax Change-Id: I4f1e1bbcf43a55b465382af914a0951aedf8c62b Change "relate" to "integrate" in README juju cmd Change-Id: I4f1e1bbcf43a55b465382af914a0951aedf8c62b --- README.md | 24 ++++++++++++------------ actions/remove_disk.py | 2 +- actions/zap_disk.py | 2 +- unit_tests/test_actions_remove_disk.py | 2 +- unit_tests/test_actions_zap_disk.py | 6 +++--- 5 files changed, 18 insertions(+), 18 deletions(-) diff --git a/README.md b/README.md index 16b12f9a..f7704ecb 100644 --- a/README.md +++ b/README.md @@ -130,7 +130,7 @@ three OSDs (one per ceph-osd unit) and three MONs: juju deploy -n 3 --config ceph-osd.yaml ceph-osd juju deploy -n 3 --to lxd:0,lxd:1,lxd:2 ceph-mon - juju add-relation ceph-osd:mon ceph-mon:osd + juju integrate ceph-osd:mon ceph-mon:osd Here, a containerised MON is running alongside each storage node. We've assumed that the machines spawned in the first command are assigned IDs of 0, 1, and 2. @@ -281,10 +281,10 @@ completely (e.g. the storage hardware is reaching EOL). Examples: # Set OSDs '0' and '1' to 'out' on unit `ceph-osd/4` - juju run-action --wait ceph-osd/4 osd-out osds=osd.0,osd.1 + juju run ceph-osd/4 osd-out osds=osd.0,osd.1 # Set all OSDs to 'out' on unit `ceph-osd/2` - juju run-action --wait ceph-osd/2 osd-out osds=all + juju run ceph-osd/2 osd-out osds=all ### Set OSDs to 'in' @@ -297,10 +297,10 @@ with the cluster 'noout' flag. Examples: # Set OSDs '0' and '1' to 'in' on unit `ceph-osd/4` - juju run-action --wait ceph-osd/4 osd-in osds=osd.0,osd.1 + juju run ceph-osd/4 osd-in osds=osd.0,osd.1 # Set all OSDs to 'in' on unit `ceph-osd/2` - juju run-action --wait ceph-osd/2 osd-in osds=all + juju run ceph-osd/2 osd-in osds=all ### Stop and start OSDs @@ -312,10 +312,10 @@ Use the `stop` and `start` actions to stop and start OSD daemons on a unit. Examples: # Stop services 'ceph-osd@0' and 'ceph-osd@1' on unit `ceph-osd/4` - juju run-action --wait ceph-osd/4 stop osds=0,1 + juju run ceph-osd/4 stop osds=0,1 # Start all ceph-osd services on unit `ceph-osd/2` - juju run-action --wait ceph-osd/2 start osds=all + juju run ceph-osd/2 start osds=all > **Note**: Stopping an OSD daemon will put the associated unit into a blocked state. @@ -339,7 +339,7 @@ The action lists the unit's block devices by categorising them in three ways: Example: # List disks on unit `ceph-osd/4` - juju run-action --wait ceph-osd/4 list-disks + juju run ceph-osd/4 list-disks ### Add a disk @@ -365,7 +365,7 @@ operator to manually add OSD volumes (for disks that are not listed by Example: # Add disk /dev/vde on unit `ceph-osd/4` - juju run-action --wait ceph-osd/4 add-disk osd-devices=/dev/vde + juju run ceph-osd/4 add-disk osd-devices=/dev/vde ### Blacklist a disk @@ -392,7 +392,7 @@ Use the `list-disks` action to list the unit's blacklist entries. Example: # Blacklist disks /dev/vda and /dev/vdf on unit `ceph-osd/0` - juju run-action --wait ceph-osd/0 \ + juju run ceph-osd/0 \ blacklist-add-disk osd-devices='/dev/vda /dev/vdf' ### Un-blacklist a disk @@ -413,7 +413,7 @@ Each device should have an existing entry in the unit's blacklist. Use the Example: # Un-blacklist disk /dev/vdb on unit `ceph-osd/1` - juju run-action --wait ceph-osd/1 \ + juju run ceph-osd/1 \ blacklist-remove-disk osd-devices=/dev/vdb ### Zap a disk @@ -441,7 +441,7 @@ action. Example: # Zap disk /dev/vdc on unit `ceph-osd/3` - juju run-action --wait ceph-osd/3 \ + juju run ceph-osd/3 \ zap-disk i-really-mean-it=true devices=/dev/vdc > **Note**: The `zap-disk` action cannot be run on a mounted device, an active diff --git a/actions/remove_disk.py b/actions/remove_disk.py index beced7d9..ec9e546f 100755 --- a/actions/remove_disk.py +++ b/actions/remove_disk.py @@ -300,7 +300,7 @@ def write_report(report, ftype): for device, action_args in report.items(): args = json.dumps(action_args, separators=(' ', '=')) args = args.replace('{', '').replace('}', '').replace('"', '') - msg += 'juju run-action {} add-disk {} {}'.format( + msg += 'juju run {} add-disk {} {}'.format( hookenv.local_unit(), 'osd-devices=' + device, args) else: msg = json.dumps(report) diff --git a/actions/zap_disk.py b/actions/zap_disk.py index 22733449..ec5ca1f2 100755 --- a/actions/zap_disk.py +++ b/actions/zap_disk.py @@ -109,7 +109,7 @@ def zap(): db.flush() hookenv.action_set({ 'message': "{} disk(s) have been zapped, to use them as OSDs, run: \n" - "juju run-action {} add-disk osd-devices=\"{}\"".format( + "juju run {} add-disk osd-devices=\"{}\"".format( len(devices), hookenv.local_unit(), " ".join(devices)) diff --git a/unit_tests/test_actions_remove_disk.py b/unit_tests/test_actions_remove_disk.py index cf96bc22..2fb7148d 100644 --- a/unit_tests/test_actions_remove_disk.py +++ b/unit_tests/test_actions_remove_disk.py @@ -131,7 +131,7 @@ class RemoveDiskActionTests(CharmTestCase): remove_disk.write_report(report, 'text') self.assertIn('message', output) msg = output['message'] - self.assertIn('juju run-action ceph-osd/0 add-disk', msg) + self.assertIn('juju run ceph-osd/0 add-disk', msg) self.assertIn('osd-devices=dev@', msg) self.assertIn('osd-ids=osd.1', msg) self.assertIn('cache-devices=cache@', msg) diff --git a/unit_tests/test_actions_zap_disk.py b/unit_tests/test_actions_zap_disk.py index 00ce17f3..fa7c1eaf 100644 --- a/unit_tests/test_actions_zap_disk.py +++ b/unit_tests/test_actions_zap_disk.py @@ -57,7 +57,7 @@ class ZapDiskActionTests(CharmTestCase): self.hookenv.action_set.assert_called_with({ 'message': "1 disk(s) have been zapped, to use " "them as OSDs, run: \njuju " - "run-action ceph-osd-test/0 add-disk " + "run ceph-osd-test/0 add-disk " "osd-devices=\"/dev/vdb\"" }) @@ -84,7 +84,7 @@ class ZapDiskActionTests(CharmTestCase): self.hookenv.action_set.assert_called_with({ 'message': "2 disk(s) have been zapped, to use " "them as OSDs, run: \njuju " - "run-action ceph-osd-test/0 add-disk " + "run ceph-osd-test/0 add-disk " "osd-devices=\"/dev/vdb /dev/vdc\"" }) @@ -182,7 +182,7 @@ class ZapDiskActionTests(CharmTestCase): self.hookenv.action_set.assert_called_with({ 'message': "1 disk(s) have been zapped, to use " "them as OSDs, run: \njuju " - "run-action ceph-osd-test/0 add-disk " + "run ceph-osd-test/0 add-disk " "osd-devices=\"/dev/vdb\"" })