diff options
author | Christian Poessinger <christian@poessinger.com> | 2020-02-29 07:25:10 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-29 07:25:10 +0100 |
commit | f1505962107f881eaf3eb41ebd99ecb4abcbc1d4 (patch) | |
tree | 976d06dd151b669eca23293f8c7e979a0c311d5c | |
parent | 7d3176beb07ab1faa156c2da76384186376cf25d (diff) | |
parent | 9213475ba47ee15e155e89026778f42135aead12 (diff) | |
download | vyos-1x-f1505962107f881eaf3eb41ebd99ecb4abcbc1d4.tar.gz vyos-1x-f1505962107f881eaf3eb41ebd99ecb4abcbc1d4.zip |
Merge pull request #231 from thomas-mangin/T2082
ifconfig: T2082: fix checking of argument passed
-rw-r--r-- | python/vyos/ifconfig.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/python/vyos/ifconfig.py b/python/vyos/ifconfig.py index 71e223a01..b1f9baabe 100644 --- a/python/vyos/ifconfig.py +++ b/python/vyos/ifconfig.py @@ -96,13 +96,13 @@ class Interface: self.config = deepcopy(self.default) self.config['ifname'] = ifname - for k in self.options: - if k not in kargs: + for k in kargs: + if k not in self.options: raise ConfigError('invalid option {} for {}'.format(k,self.__class__)) self.config[k] = kargs[k] for k in self.required: - if k not in self.config: + if k not in kargs: raise ConfigError('missing required option {} for {}'.format(k,self.__class__)) if not os.path.exists('/sys/class/net/{}'.format(self.config['ifname'])): |