@@ -87,20 +87,20 @@ class OnboardingManager:
87
87
88
88
def __init__ (self , ot , username , password , secret ):
89
89
"""Inits class."""
90
- self .username = username
91
- self .password = password
92
- self .secret = secret
93
-
94
90
# Create instance of Onboarding Task Manager class:
95
91
otm = OnboardingTaskManager (ot )
96
92
93
+ self .username = username or settings .NAPALM_USERNAME
94
+ self .password = password or settings .NAPALM_PASSWORD
95
+ self .secret = secret or otm .optional_args .get ("secret" , None ) or settings .NAPALM_ARGS .get ("secret" , None )
96
+
97
97
netdev = NetdevKeeper (
98
98
hostname = otm .ip_address ,
99
99
port = otm .port ,
100
100
timeout = otm .timeout ,
101
- username = self .username or settings . NAPALM_USERNAME ,
102
- password = self .password or settings . NAPALM_PASSWORD ,
103
- secret = self .secret or otm . optional_args . get ( "secret" , None ) or settings . NAPALM_ARGS . get ( "secret" , None ) ,
101
+ username = self .username ,
102
+ password = self .password ,
103
+ secret = self .secret ,
104
104
napalm_driver = otm .napalm_driver ,
105
105
optional_args = otm .optional_args or settings .NAPALM_ARGS ,
106
106
)
@@ -129,6 +129,7 @@ def __init__(self, ot, username, password, secret):
129
129
}
130
130
131
131
onboarding_cls = netdev_dict ["onboarding_class" ]()
132
+ onboarding_cls .credentials = {"username" : self .username , "password" : self .password , "secret" : self .secret }
132
133
onboarding_cls .run (onboarding_kwargs = onboarding_kwargs )
133
134
134
135
self .created_device = onboarding_cls .created_device
0 commit comments