Fix network modules for ziploader changes

pull/15316/head
Nathaniel Case 9 years ago committed by Toshio Kuratomi
parent 54a3a14428
commit 77e3dc9e6a

@ -194,16 +194,15 @@ class NetworkModule(AnsibleModule):
return self._config return self._config
def _load_params(self): def _load_params(self):
params = super(NetworkModule, self)._load_params() super(NetworkModule, self)._load_params()
provider = params.get('provider') or dict() provider = self.params.get('provider') or dict()
for key, value in provider.items(): for key, value in provider.items():
if key in NET_COMMON_ARGS: if key in NET_COMMON_ARGS:
if params.get(key) is None and value is not None: if self.params.get(key) is None and value is not None:
params[key] = value self.params[key] = value
for key, env_var in NET_ENV_ARGS.items(): for key, env_var in NET_ENV_ARGS.items():
if params.get(key) is None and env_var in os.environ: if self.params.get(key) is None and env_var in os.environ:
params[key] = os.environ[env_var] self.params[key] = os.environ[env_var]
return params
def connect(self): def connect(self):
try: try:

@ -109,12 +109,12 @@ class NetworkModule(AnsibleModule):
return self._config return self._config
def _load_params(self): def _load_params(self):
params = super(NetworkModule, self)._load_params() super(NetworkModule, self)._load_params()
provider = params.get('provider') or dict() provider = self.params.get('provider') or dict()
for key, value in provider.items(): for key, value in provider.items():
if key in NET_COMMON_ARGS.keys(): if key in NET_COMMON_ARGS.keys():
params[key] = value if self.params.get(key) is None and value is not None:
return params self.params[key] = value
def connect(self): def connect(self):
try: try:

@ -99,12 +99,12 @@ class NetworkModule(AnsibleModule):
return self._config return self._config
def _load_params(self): def _load_params(self):
params = super(NetworkModule, self)._load_params() super(NetworkModule, self)._load_params()
provider = params.get('provider') or dict() provider = self.params.get('provider') or dict()
for key, value in provider.items(): for key, value in provider.items():
if key in NET_COMMON_ARGS.keys(): if key in NET_COMMON_ARGS.keys():
params[key] = value if self.params.get(key) is None and value is not None:
return params self.params[key] = value
def connect(self): def connect(self):
try: try:

@ -76,12 +76,12 @@ class NetworkModule(AnsibleModule):
return self._config return self._config
def _load_params(self): def _load_params(self):
params = super(NetworkModule, self)._load_params() super(NetworkModule, self)._load_params()
provider = params.get('provider') or dict() provider = self.params.get('provider') or dict()
for key, value in provider.items(): for key, value in provider.items():
if key in NET_COMMON_ARGS.keys(): if key in NET_COMMON_ARGS.keys():
params[key] = value if self.params.get(key) is None and value is not None:
return params self.params[key] = value
def connect(self): def connect(self):
self.connection = Cli(self) self.connection = Cli(self)

@ -197,13 +197,12 @@ class NetworkModule(AnsibleModule):
return self._config return self._config
def _load_params(self): def _load_params(self):
params = super(NetworkModule, self)._load_params() super(NetworkModule, self)._load_params()
provider = params.get('provider') or dict() provider = self.params.get('provider') or dict()
for key, value in provider.items(): for key, value in provider.items():
if key in NET_COMMON_ARGS.keys(): if key in NET_COMMON_ARGS.keys():
if not params.get(key) and value is not None: if self.params.get(key) is None and value is not None:
params[key] = value self.params[key] = value
return params
def connect(self): def connect(self):
if self.params['transport'] == 'nxapi': if self.params['transport'] == 'nxapi':

@ -176,12 +176,12 @@ class NetworkModule(AnsibleModule):
return self._config return self._config
def _load_params(self): def _load_params(self):
params = super(NetworkModule, self)._load_params() super(NetworkModule, self)._load_params()
provider = params.get('provider') or dict() provider = self.params.get('provider') or dict()
for key, value in provider.items(): for key, value in provider.items():
if key in NET_COMMON_ARGS.keys(): if key in NET_COMMON_ARGS.keys():
params[key] = value if self.params.get(key) is None and value is not None:
return params self.params[key] = value
def connect(self): def connect(self):
if self.params['transport'] == 'rest': if self.params['transport'] == 'rest':

Loading…
Cancel
Save