summaryrefslogtreecommitdiff
path: root/novaclient/v2
diff options
context:
space:
mode:
authorTakashi NATSUME <natsume.takashi@lab.ntt.co.jp>2019-07-17 11:40:24 +0900
committerTakashi NATSUME <natsume.takashi@lab.ntt.co.jp>2019-09-18 23:08:28 +0000
commitd1c5dc61d60b29428484a38703a0064933cc7c0e (patch)
treeb760bdcc31d2cee26eb1f5615757cf7472449e61 /novaclient/v2
parent730bc2c47ede9eca44b400f74540418765fcab66 (diff)
downloadpython-novaclient-d1c5dc61d60b29428484a38703a0064933cc7c0e.tar.gz
Add a check for --config-drive option on nova boot
A value of the '--config-drive' option must be a boolean value on the 'nova boot' command because nova accepts a boolean value only for the 'config_drive' parameter. So add a check for the '--config-drive' option on the 'nova boot' command. Fix a description for 'config_drive' parameter in the 'create' method of the novaclient.v2.ServerManager class. Change-Id: Ic6e65139302fbb662fb6ba60e73633dad8ffb72e Closes-Bug: #1825061
Diffstat (limited to 'novaclient/v2')
-rw-r--r--novaclient/v2/servers.py4
-rw-r--r--novaclient/v2/shell.py6
2 files changed, 6 insertions, 4 deletions
diff --git a/novaclient/v2/servers.py b/novaclient/v2/servers.py
index 9870be0b..1351189b 100644
--- a/novaclient/v2/servers.py
+++ b/novaclient/v2/servers.py
@@ -1375,8 +1375,8 @@ class ServerManager(base.BootingManagerWithFind):
any networking for the server.
:param scheduler_hints: (optional extension) arbitrary key-value pairs
specified by the client to help boot an instance
- :param config_drive: (optional extension) value for config drive
- either boolean, or volume-id
+ :param config_drive: (optional extension) a boolean value to enable
+ config drive
:param disk_config: (optional extension) control how the disk is
partitioned when the server is created. possible
values are 'AUTO' or 'MANUAL'.
diff --git a/novaclient/v2/shell.py b/novaclient/v2/shell.py
index 2dfd5c92..5aab35af 100644
--- a/novaclient/v2/shell.py
+++ b/novaclient/v2/shell.py
@@ -506,7 +506,9 @@ def _boot(cs, args):
elif str(args.config_drive).lower() in ("false", "0", "", "none"):
config_drive = None
else:
- config_drive = args.config_drive
+ raise exceptions.CommandError(
+ _("The value of the '--config-drive' option must be "
+ "a boolean value."))
boot_kwargs = dict(
meta=meta,
@@ -906,7 +908,7 @@ def _boot(cs, args):
metavar="<value>",
dest='config_drive',
default=False,
- help=_("Enable config drive."))
+ help=_("Enable config drive. The value must be a boolean value."))
@utils.arg(
'--poll',
dest='poll',