Revision eb28ecf6

b/lib/cli.py
207 207
  "SplitNodeOption",
208 208
  "CalculateOSNames",
209 209
  "ParseFields",
210
  "COMMON_CREATE_OPTS",
210 211
  ]
211 212

  
212 213
NO_PREFIX = "no_"
......
1103 1104
#: Options provided by all commands
1104 1105
COMMON_OPTS = [DEBUG_OPT]
1105 1106

  
1107
# common options for creating instances. add and import then add their own
1108
# specific ones.
1109
COMMON_CREATE_OPTS = [
1110
  BACKEND_OPT,
1111
  DISK_OPT,
1112
  DISK_TEMPLATE_OPT,
1113
  FILESTORE_DIR_OPT,
1114
  FILESTORE_DRIVER_OPT,
1115
  HYPERVISOR_OPT,
1116
  IALLOCATOR_OPT,
1117
  NET_OPT,
1118
  NODE_PLACEMENT_OPT,
1119
  NOIPCHECK_OPT,
1120
  NONAMECHECK_OPT,
1121
  NONICS_OPT,
1122
  NWSYNC_OPT,
1123
  OSPARAMS_OPT,
1124
  OS_SIZE_OPT,
1125
  SUBMIT_OPT,
1126
  DRY_RUN_OPT,
1127
  PRIORITY_OPT,
1128
  ]
1129

  
1106 1130

  
1107 1131
def _ParseArgs(argv, commands, aliases):
1108 1132
  """Parser for the command line arguments.
b/lib/client/__init__.py
18 18
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
19 19
# 02110-1301, USA.
20 20

  
21

  
22
"""Empty file for package definition.
21
"""Common command line client code.
23 22

  
24 23
"""
b/lib/client/gnt_backup.py
115 115

  
116 116
# this is defined separately due to readability only
117 117
import_opts = [
118
  BACKEND_OPT,
119
  DISK_OPT,
120
  DISK_TEMPLATE_OPT,
121
  FILESTORE_DIR_OPT,
122
  FILESTORE_DRIVER_OPT,
123
  HYPERVISOR_OPT,
124
  IALLOCATOR_OPT,
125 118
  IDENTIFY_DEFAULTS_OPT,
126
  NET_OPT,
127
  NODE_PLACEMENT_OPT,
128
  NOIPCHECK_OPT,
129
  NONAMECHECK_OPT,
130
  NONICS_OPT,
131
  NWSYNC_OPT,
132
  OSPARAMS_OPT,
133
  OS_SIZE_OPT,
134 119
  SRC_DIR_OPT,
135 120
  SRC_NODE_OPT,
136
  SUBMIT_OPT,
137
  DRY_RUN_OPT,
138
  PRIORITY_OPT,
139 121
  ]
140 122

  
141 123

  
......
152 134
    "-n <target_node> [opts...] <name>",
153 135
    "Exports an instance to an image"),
154 136
  'import': (
155
    ImportInstance, ARGS_ONE_INSTANCE, import_opts,
137
    ImportInstance, ARGS_ONE_INSTANCE, COMMON_CREATE_OPTS + import_opts,
156 138
    "[...] -t disk-type -n node[:secondary-node] <name>",
157 139
    "Imports an instance from an exported image"),
158 140
  'remove': (
b/lib/client/gnt_instance.py
1377 1377

  
1378 1378
# this is defined separately due to readability only
1379 1379
add_opts = [
1380
  BACKEND_OPT,
1381
  DISK_OPT,
1382
  DISK_TEMPLATE_OPT,
1383
  FILESTORE_DIR_OPT,
1384
  FILESTORE_DRIVER_OPT,
1385
  HYPERVISOR_OPT,
1386
  IALLOCATOR_OPT,
1387
  NET_OPT,
1388
  NODE_PLACEMENT_OPT,
1389
  NOIPCHECK_OPT,
1390
  NONAMECHECK_OPT,
1391
  NONICS_OPT,
1392 1380
  NOSTART_OPT,
1393
  NWSYNC_OPT,
1394
  OSPARAMS_OPT,
1395 1381
  OS_OPT,
1396 1382
  FORCE_VARIANT_OPT,
1397 1383
  NO_INSTALL_OPT,
1398
  OS_SIZE_OPT,
1399
  SUBMIT_OPT,
1400
  DRY_RUN_OPT,
1401
  PRIORITY_OPT,
1402 1384
  ]
1403 1385

  
1404 1386
commands = {
1405 1387
  'add': (
1406
    AddInstance, [ArgHost(min=1, max=1)], add_opts,
1388
    AddInstance, [ArgHost(min=1, max=1)], COMMON_CREATE_OPTS + add_opts,
1407 1389
    "[...] -t disk-type -n node[:secondary-node] -o os-type <name>",
1408 1390
    "Creates and adds a new instance to the cluster"),
1409 1391
  'batch-create': (

Also available in: Unified diff