@@ 220-230 (lines=11) @@ | ||
217 | ||
218 | cmd.add_element("certificate", certificate) |
|
219 | ||
220 | if ( |
|
221 | credential_type == CredentialType.USERNAME_PASSWORD |
|
222 | or credential_type == CredentialType.USERNAME_SSH_KEY |
|
223 | or credential_type == CredentialType.SNMP |
|
224 | ): |
|
225 | if not login: |
|
226 | raise RequiredArgument( |
|
227 | function=self.create_credential.__name__, argument='login', |
|
228 | ) |
|
229 | ||
230 | cmd.add_element("login", login) |
|
231 | ||
232 | if credential_type == CredentialType.PASSWORD_ONLY and not password: |
|
233 | raise RequiredArgument( |
@@ 647-657 (lines=11) @@ | ||
644 | ||
645 | cmd.add_element("certificate", certificate) |
|
646 | ||
647 | if ( |
|
648 | credential_type == CredentialType.USERNAME_PASSWORD |
|
649 | or credential_type == CredentialType.USERNAME_SSH_KEY |
|
650 | or credential_type == CredentialType.SNMP |
|
651 | ): |
|
652 | if not login: |
|
653 | raise RequiredArgument( |
|
654 | function=self.create_credential.__name__, argument="login", |
|
655 | ) |
|
656 | ||
657 | cmd.add_element("login", login) |
|
658 | ||
659 | if ( |
|
660 | credential_type == CredentialType.USERNAME_PASSWORD |