Revision 58602137

b/kamaki/cli/commands/networking.py
152 152
    def _run(self, name):
153 153
        #  admin_state_up is not used in Cyclades
154 154
        net = self.client.create_network(
155
            name, admin_state_up=True, shared=self['shared'])
155
            name, shared=self['shared'])
156 156
        self._print(net, self.print_dict)
157 157

  
158 158
    def main(self, name):
......
166 166

  
167 167
    @errors.generic.all
168 168
    @errors.cyclades.connection
169
    @errors.cyclades.network_id
169 170
    def _run(self, network_id):
170 171
        r = self.client.delete_network(network_id)
171 172
        self._optional_output(r)
......
173 174
    def main(self, network_id):
174 175
        super(self.__class__, self)._run()
175 176
        self._run(network_id=network_id)
177

  
178

  
179
@command(network_cmds)
180
class network_set(_init_networking, _optional_json):
181
    """Set an attribute of a network, leave the rest untouched (update)
182
    Only "--name" is supported for now
183
    """
184

  
185
    arguments = dict(name=ValueArgument('New name of the network', '--name'))
186

  
187
    @errors.generic.all
188
    @errors.cyclades.connection
189
    @errors.cyclades.network_id
190
    def _run(self, network_id):
191
        if self['name'] in (None, ):
192
            raise CLISyntaxError(
193
                'Missing network atrributes to update',
194
                details=[
195
                    'At least one if the following is expected:',
196
                    '  --name=<new name>'])
197
        r = self.client.update_network(network_id, name=self['name'])
198
        self._print(r, self.print_dict)
199

  
200
    def main(self, network_id):
201
        super(self.__class__, self)._run()
202
        self._run(network_id=network_id)

Also available in: Unified diff