Revision 776b275c kamaki/cli/commands/pithos.py

b/kamaki/cli/commands/pithos.py
131 131
        return getattr(self, '_value', self.default)
132 132

  
133 133
    @value.setter
134
    def value(self, newvalue):
135
        if newvalue is None:
134
    def value(self, newvalues):
135
        if not newvalues:
136 136
            self._value = self.default
137 137
            return
138
        start, sep, end = newvalue.partition('-')
139
        if sep:
140
            if start:
141
                self._value = '%s-%s' % (int(start), int(end))
138
        self._value = ''
139
        for newvalue in newvalues.split(','):
140
            self._value = ('%s,' % self._value) if self._value else ''
141
            start, sep, end = newvalue.partition('-')
142
            if sep:
143
                if start:
144
                    start, end = (int(start), int(end))
145
                    assert start <= end, 'Invalid range value %s' % newvalue
146
                    self._value += '%s-%s' % (int(start), int(end))
147
                else:
148
                    self._value += '-%s' % int(end)
142 149
            else:
143
                self._value = '-%s' % int(end)
144
        else:
145
            self._value = '%s' % int(start)
150
                self._value += '%s' % int(start)
146 151

  
147 152

  
148 153
# Command specs

Also available in: Unified diff