Revision 8b46606c lib/cli.py

b/lib/cli.py
54 54
           "GetOnlineNodes", "JobExecutor", "SYNC_OPT", "CONFIRM_OPT",
55 55
           ]
56 56

  
57
NO_PREFIX = "no_"
58
UN_PREFIX = "-"
57 59

  
58 60
def _ExtractTagsObject(opts, args):
59 61
  """Extract the tag type object.
......
256 258
  @raises errors.ParameterError: if there are duplicate keys
257 259

  
258 260
  """
259
  NO_PREFIX = "no_"
260
  UN_PREFIX = "-"
261 261
  kv_dict = {}
262 262
  if data:
263 263
    for elem in data.split(","):
......
282 282

  
283 283
  """
284 284
  if ":" not in value:
285
    retval =  (value, {})
285
    ident, rest = value, ''
286 286
  else:
287 287
    ident, rest = value.split(":", 1)
288

  
289
  if ident.startswith(NO_PREFIX):
290
    if rest:
291
      msg = "Cannot pass options when removing parameter groups: %s" % value
292
      raise errors.ParameterError(msg)
293
    retval = (ident[len(NO_PREFIX):], False)
294
  elif ident.startswith(UN_PREFIX):
295
    if rest:
296
      msg = "Cannot pass options when removing parameter groups: %s" % value
297
      raise errors.ParameterError(msg)
298
    retval = (ident[len(UN_PREFIX):], None)
299
  else:
288 300
    kv_dict = _SplitKeyVal(opt, rest)
289 301
    retval = (ident, kv_dict)
290 302
  return retval

Also available in: Unified diff