diff options
author | Richard Ipsum <richard.ipsum@codethink.co.uk> | 2015-04-15 15:58:34 +0100 |
---|---|---|
committer | Richard Ipsum <richard.ipsum@codethink.co.uk> | 2015-04-15 16:04:38 +0100 |
commit | 64465445f2a95d74cb4a5bae3ab0d1783d6de68e (patch) | |
tree | 3fc139f4a9829ff31662ee17acaddea8ce3ed6e5 /simple-network.configure | |
parent | ef08b64d0c81515a360ceea1d0068a7a9d4233d9 (diff) | |
download | definitions-64465445f2a95d74cb4a5bae3ab0d1783d6de68e.tar.gz |
Add dns option to simple-network conf ext
Change-Id: I0f4490d76caca802536b21085ea0d770fb8c0798
Diffstat (limited to 'simple-network.configure')
-rwxr-xr-x | simple-network.configure | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/simple-network.configure b/simple-network.configure index 1ba94e86..4a70f311 100755 --- a/simple-network.configure +++ b/simple-network.configure @@ -188,7 +188,9 @@ class SimpleNetworkConfigurationExtension(cliapp.Application): address = None netmask = None gateway = None + dns = None lines = [] + for pair in pairs: if pair[0] == 'address': address = pair[1] @@ -196,6 +198,8 @@ class SimpleNetworkConfigurationExtension(cliapp.Application): netmask = pair[1] elif pair[0] == 'gateway': gateway = pair[1] + elif pair[0] == 'dns': + dns = pair[1] if address and netmask: network_suffix = self.convert_net_mask_to_cidr_suffix (netmask); @@ -204,9 +208,12 @@ class SimpleNetworkConfigurationExtension(cliapp.Application): elif address or netmask: raise Exception('address and netmask must be specified together') - if gateway is not None: + if gateway: lines += ["Gateway=%s" % gateway] + if dns: + lines += ["DNS=%s" % dns] + return lines def convert_net_mask_to_cidr_suffix(self, mask): |