diff options
author | Steven Hardy <shardy@redhat.com> | 2015-01-22 11:33:38 +0000 |
---|---|---|
committer | Steven Hardy <shardy@redhat.com> | 2015-02-24 09:20:55 +0000 |
commit | 70c235d30aee3a401414f622b3de4f09f4b3d180 (patch) | |
tree | 323c5f65cfa02701ef2ae208e917e3e06a434e2e /os_net_config/__init__.py | |
parent | a4ad189558a414c6029b4dfbc8e459339ebe534d (diff) |
Move noop flag to provider base-class
Moving this flag makes it easier to implement additional functions
which work differently depending on noop mode being set, vs passing
it into every function like apply()
Change-Id: I796792aece3e40322523e910a3b87f7ab9a451dd
Diffstat (limited to 'os_net_config/__init__.py')
-rw-r--r-- | os_net_config/__init__.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/os_net_config/__init__.py b/os_net_config/__init__.py index 484c1e4..3b01b71 100644 --- a/os_net_config/__init__.py +++ b/os_net_config/__init__.py @@ -24,6 +24,9 @@ class NotImplemented(Exception): class NetConfig(object): """Configure network interfaces using the ifcfg format.""" + def __init__(self, noop=False): + self.noop = noop + def add_object(self, obj): """Convenience method to add any type of object to the network config. See objects.py. @@ -71,10 +74,9 @@ class NetConfig(object): """ raise NotImplemented("add_bond is not implemented.") - def apply(self, noop=False, cleanup=False): + def apply(self, cleanup=False): """Apply the network configuration. - :param noop: A boolean which indicates whether this is a no-op. :param cleanup: A boolean which indicates whether any undefined (existing but not present in the object model) interfaces should be disabled and deleted. |