diff --git a/designate/cmd/manage.py b/designate/cmd/manage.py index a2befdc08..08cc472c7 100644 --- a/designate/cmd/manage.py +++ b/designate/cmd/manage.py @@ -89,7 +89,7 @@ def get_arg_string(args): else: arg = args - return arg + return arg.replace('-', '_') def fetch_func_args(func): diff --git a/designate/manage/pool.py b/designate/manage/pool.py index 40d4aab3e..0fcb370b9 100644 --- a/designate/manage/pool.py +++ b/designate/manage/pool.py @@ -85,10 +85,12 @@ class PoolCommands(base.Commands): '--delete', help='Any Pools not listed in the config file will be deleted. ' ' WARNING: This will delete any zones left in this pool', + action="store_true", default=False) @base.args( - '--dry_run', + '--dry-run', help='This will simulate what will happen when you run this command', + action="store_true", default=False) def update(self, file, delete, dry_run): self._startup() diff --git a/doc/source/admin/multiple-pools.rst b/doc/source/admin/multiple-pools.rst index b432b861b..9206a052e 100644 --- a/doc/source/admin/multiple-pools.rst +++ b/doc/source/admin/multiple-pools.rst @@ -150,7 +150,7 @@ the pool configuration. .. code-block:: bash # Do a dry run - $ designate-manage pool update --file pools.yml --dry_run + $ designate-manage pool update --file pools.yml --dry-run $ designate-manage pool update --file pools.yml Designate now has two pools to work with. The next step will be to diff --git a/doc/source/admin/pools.rst b/doc/source/admin/pools.rst index 697dbf279..025cd2aa6 100644 --- a/doc/source/admin/pools.rst +++ b/doc/source/admin/pools.rst @@ -102,16 +102,16 @@ Options: """""""" --file Input file (Default: ``/etc/designate/pools.yaml``) - --dry_run Simulate an update. (Default: False) - --delete Delete Pools that are not in the input file (Defaults: False) + --dry-run This will simulate what will happen when you run this command + --delete Any Pools not listed in the config file will be deleted .. warning:: - | Running with ``--delete True`` can be **extremely** dangerous. + | Running with ``--delete`` can be **extremely** dangerous. | It will delete any pools that are not in the supplied YAML file, and any | zones that are in that Pool. - | Before running with ``--delete True`` we recommend operators run with - | ``--delete True --dry_run True`` to view the outcome. + | Before running with ``--delete`` we recommend operators run with + | ``--delete --dry-run`` to view the outcome. diff --git a/doc/source/cli/designate-manage.rst b/doc/source/cli/designate-manage.rst index a7eff862a..232ffc07a 100644 --- a/doc/source/cli/designate-manage.rst +++ b/doc/source/cli/designate-manage.rst @@ -155,8 +155,8 @@ designate-manage pool update .. code-block:: console - usage: designate-manage pool update [-h] [--file FILE] [--delete DELETE] - [--dry_run DRY_RUN] + usage: designate-manage pool update [-h] [--file FILE] [--delete] + [--dry-run] Update the running pool config from a YAML file @@ -170,11 +170,11 @@ Update the running pool config from a YAML file The path to the file that should be used to update the pools config (Defaults to /etc/designate/pools.yaml) -``--delete DELETE`` +``--delete`` Any Pools not listed in the config file will be deleted. .. warning:: This will delete any zones left in this pool -``--dry_run DRY_RUN`` +``--dry-run`` This will simulate what will happen when you run this command diff --git a/releasenotes/notes/update-designate-manage-command-af0aec02ab582d50.yaml b/releasenotes/notes/update-designate-manage-command-af0aec02ab582d50.yaml new file mode 100644 index 000000000..5a2804add --- /dev/null +++ b/releasenotes/notes/update-designate-manage-command-af0aec02ab582d50.yaml @@ -0,0 +1,12 @@ +--- +upgrade: + - | + Update command ``designate-manage pool update``, change ``--dry_run`` to + ``--dry-run``, and change ``--delete`` and ``--dry-run`` as switchs not + key value pair. + e.g. + + .. code-block:: bash + + $ designate-manage pool update --file pools.yml --delete --dry-run +