Revision 15fd9fd5 lib/rapi/baserlib.py

b/lib/rapi/baserlib.py
78 78
  return dict(zip(names, data))
79 79

  
80 80

  
81
def _Tags_GET(kind, name=None):
81
def _Tags_GET(kind, name=""):
82 82
  """Helper function to retrieve tags.
83 83

  
84 84
  """
85
  if name is None:
86
    # Do not cause "missing parameter" error, which happens if a parameter
87
    # is None.
88
    name = ""
89 85
  op = ganeti.opcodes.OpGetTags(kind=kind, name=name)
90 86
  tags = ganeti.cli.SubmitOpCode(op)
91 87
  return list(tags)
92 88

  
93 89

  
94
def _Tags_POST(kind, tags, name=None):
90
def _Tags_POST(kind, tags, name=""):
95 91
  """Helper function to set tags.
96 92

  
97 93
  """
98
  if name is None:
99
    # Do not cause "missing parameter" error, which happens if a parameter
100
    # is None.
101
    name = ""
102 94
  cl = luxi.Client()
103 95
  return cl.SubmitJob([ganeti.opcodes.OpAddTags(kind=kind, name=name,
104 96
                                                tags=tags)])
105 97

  
106 98

  
99
def _Tags_DELETE(kind, tags, name=""):
100
  """Helper function to delete tags.
101

  
102
  """
103
  cl = luxi.Client()
104
  return cl.SubmitJob([ganeti.opcodes.OpDelTags(kind=kind, name=name,
105
                                                tags=tags)])
106

  
107

  
107 108
def MapBulkFields(itemslist, fields):
108 109
  """Map value to field name in to one dictionary.
109 110

  

Also available in: Unified diff