summaryrefslogtreecommitdiffstats
path: root/cobbler/modules/cli_network.py
diff options
context:
space:
mode:
Diffstat (limited to 'cobbler/modules/cli_network.py')
-rw-r--r--cobbler/modules/cli_network.py13
1 files changed, 2 insertions, 11 deletions
diff --git a/cobbler/modules/cli_network.py b/cobbler/modules/cli_network.py
index 31ab07e8..3f4ff23c 100644
--- a/cobbler/modules/cli_network.py
+++ b/cobbler/modules/cli_network.py
@@ -82,13 +82,13 @@ class NetworkFunction(commands.CobblerFunction):
if self.options.cidr is not None:
obj.set_cidr(self.options.cidr)
- else:
+ elif self.matches_args(self.args, ['add']):
raise CX(_("cidr is required"))
if self.options.address is not None:
obj.set_address(self.options.address)
elif self.matches_args(self.args, ["add"]):
- obj.set_address(_CIDR(self.options.cidr)[0])
+ obj.set_address(obj.cidr[0])
if self.options.broadcast is not None:
obj.set_broadcast(self.options.broadcast)
@@ -109,15 +109,6 @@ class NetworkFunction(commands.CobblerFunction):
if self.options.comment is not None:
obj.set_comment(self.options.comment)
- obj.update_free()
-
-# if 'add' in self.args:
-# obj.sync('add')
-# elif 'edit' in self.args:
-# obj.sync('edit')
-# elif 'remove' in self.args:
-# obj.sync('remove')
-
return self.object_manipulator_finish(obj, self.api.networks, self.options)