Revision ab3e6da8

b/lib/cmdlib.py
2015 2015
      invalid_hvs = set(self.hv_list) - constants.HYPER_TYPES
2016 2016
      if invalid_hvs:
2017 2017
        raise errors.OpPrereqError("Enabled hypervisors contains invalid"
2018
                                   " entries: %s" % " ,".join(invalid_hvs),
2018
                                   " entries: %s" %
2019
                                   utils.CommaJoin(invalid_hvs),
2019 2020
                                   errors.ECODE_INVAL)
2020 2021
    else:
2021 2022
      self.hv_list = cluster.enabled_hypervisors
b/lib/hypervisor/hv_base.py
82 82

  
83 83
  """
84 84
  fn = lambda x: x in my_set
85
  err = ("The value must be one of: %s" % " ,".join(my_set))
85
  err = ("The value must be one of: %s" % utils.CommaJoin(my_set))
86 86
  return (required, fn, err, None, None)
87 87

  
88 88

  
b/lib/utils.py
1884 1884
  return resu
1885 1885

  
1886 1886

  
1887
def CommaJoin(names):
1888
  """Nicely join a set of identifiers.
1889

  
1890
  @param names: set, list or tuple
1891
  @return: a string with the formatted results
1892

  
1893
  """
1894
  return ", ".join(["'%s'" % val for val in names])
1895

  
1896

  
1887 1897
def BytesToMebibyte(value):
1888 1898
  """Converts bytes to mebibytes.
1889 1899

  
b/scripts/gnt-node
98 98
             choices=_USER_STORAGE_TYPE.keys(),
99 99
             default=None,
100 100
             metavar="STORAGE_TYPE",
101
             help=("Storage type (%s)" % " ,".join(_USER_STORAGE_TYPE.keys())))
101
             help=("Storage type (%s)" %
102
                   utils.CommaJoin(_USER_STORAGE_TYPE.keys())))
102 103

  
103 104
_REPAIRABLE_STORAGE_TYPES = \
104 105
  [st for st, so in constants.VALID_STORAGE_OPERATIONS.iteritems()
b/test/docs_unittest.py
114 114

  
115 115
    self.failIf(undocumented,
116 116
                msg=("Missing RAPI resource documentation for %s" %
117
                     " ,".join(undocumented)))
117
                     utils.CommaJoin(undocumented)))
118 118

  
119 119

  
120 120
class TestManpages(unittest.TestCase):
......
145 145

  
146 146
    self.failIf(missing,
147 147
                msg=("Manpage for '%s' missing documentation for %s" %
148
                     (script, " ,".join(missing))))
148
                     (script, utils.CommaJoin(missing))))
149 149

  
150 150

  
151 151
if __name__ == "__main__":

Also available in: Unified diff