remotelogin/devices/properties.py
def _set_conn_credentials_args(self, user):
        """ if the connection does not provide the username we will use the device user credential """

        if user:
            user = self.manager.users[user]
        else:
            user = self.user or self.manager.users.default

            if not user:
                raise NoDefaultUserError(
                    "you need to provide a user or set the device or "
                    "connection with a default user"
                )

        kwargs = user.get_kwargs(self._conn_cls.ARGUMENTS_ALLOWED)

        if self._conn_cls.NEEDS_AUTHENTICATION:
            for combination in self.cls.AUTHENTICATION_KEYS_COMBINATIONS:
                if all([getattr(user, key) for key in combination]):
                    break
            else:  # nobreak
                comb_str = (
                    " and ".join(combination)
                    for combination in self.cls.AUTHENTICATION_KEYS_COMBINATIONS
                )
                raise UserAuthenticationValuesError(
                    '\n\nThe user "{}" does not have any of the required combinations '
                    "information to login correctly.\nAllowed combinations: {}"
                    "".format(user.username, " or ".join(comb_str))
                )

        if self.expected_prompt:
            kwargs["expected_prompt"] = self.expected_prompt

        return kwargs, user
 if the connection does not provide the username we will use the device user credential 
if the connection does not provide the username we will use the device user credential
if the connection does not provide the username we will use the device user credential
def _set_conn_credentials_args(self, user):
        if user:
            user = self.manager.users[user]
        else:
            user = self.user or self.manager.users.default
            if not user:
                raise NoDefaultUserError(
                    "you need to provide a user or set the device or "
                    "connection with a default user"
                )
        kwargs = user.get_kwargs(self._conn_cls.ARGUMENTS_ALLOWED)
        if self._conn_cls.NEEDS_AUTHENTICATION:
            for combination in self.cls.AUTHENTICATION_KEYS_COMBINATIONS:
                if all([getattr(user, key) for key in combination]):
                    break
            else:  
                comb_str = (
                    " and ".join(combination)
                    for combination in self.cls.AUTHENTICATION_KEYS_COMBINATIONS
                )
                raise UserAuthenticationValuesError(
                    '\n\nThe user "{}" does not have any of the required combinations '
                    "information to login correctly.\nAllowed combinations: {}"
                    "".format(user.username, " or ".join(comb_str))
                )
        if self.expected_prompt:
            kwargs["expected_prompt"] = self.expected_prompt
        return kwargs, user
def _set_conn_credentials_args ( self , user ) : if user : user = self . manager . users [ user ] else : user = self . user or self . manager . users . default if not user : raise NoDefaultUserError ( "you need to provide a user or set the device or " "connection with a default user" ) kwargs = user . get_kwargs ( self . _conn_cls . ARGUMENTS_ALLOWED ) if self . _conn_cls . NEEDS_AUTHENTICATION : for combination in self . cls . AUTHENTICATION_KEYS_COMBINATIONS : if all ( [ getattr ( user , key ) for key in combination ] ) : break else : comb_str = ( " and " . join ( combination ) for combination in self . cls . AUTHENTICATION_KEYS_COMBINATIONS ) raise UserAuthenticationValuesError ( '\n\nThe user "{}" does not have any of the required combinations ' "information to login correctly.\nAllowed combinations: {}" "" . format ( user . username , " or " . join ( comb_str ) ) ) if self . expected_prompt : kwargs [ "expected_prompt" ] = self . expected_prompt return kwargs , user
if the connection does not provide the username we will use the device user credential
if the connection does not provide the username we will use the device user credential
""" if the connection does not provide the username we will use the device user credential """ # nobreak
self
user