(self, user)
return True
Setup user for engines without root support.
        Equivalent to _setup_container_user() for engines without root support.
Setup user for engines without root support.
        Equivalent to _setup_container_user() for engines without root support.
Setup user for engines without root support . Equivalent to _setup_container_user () for engines without root support .
def _setup_container_user_noroot(self, user):
        """ Setup user for engines without root support.
        Equivalent to _setup_container_user() for engines without root support.
        """
        host_auth = NixAuthentication()
        (passwd, group) = self._select_auth_files()
        container_auth = NixAuthentication(passwd, group)
        if not user:
            user = HostInfo().username()
        (valid_user, user_id) = self._user_from_str(user,
                                                    host_auth, container_auth)
        if not valid_user:
            Msg().err("Error: invalid syntax for user", user)
            return False
        if self.opt["user"] == "root":
            self.opt["user"] = HostInfo().username()
            self.opt["uid"] = str(HostInfo.uid)
            self.opt["gid"] = str(HostInfo.gid)
        if (self._is_mountpoint("/etc/passwd") or
                self._is_mountpoint("/etc/group")):
            self.opt["hostauth"] = self.opt["containerauth"] = False
            return True
        if self.opt["user"]:
            self.opt["uid"] = str(HostInfo.uid)
            self.opt["gid"] = str(HostInfo.gid)
        else:
            if self.opt["hostauth"] or self.opt["containerauth"]:
                Msg().err("Error: user not found on host")
                return False
            self.opt["user"] = user_id["user"] if "user" in user_id else user
            self.opt["uid"] = user_id["uid"] if "uid" in user_id else ""
            self.opt["gid"] = user_id["gid"] if "gid" in user_id else ""
        self._create_user(container_auth, host_auth)
        return True
def _setup_container_user_noroot ( self , user ) : host_auth = NixAuthentication ( ) ( passwd , group ) = self . _select_auth_files ( ) container_auth = NixAuthentication ( passwd , group ) if not user : user = HostInfo ( ) . username ( ) ( valid_user , user_id ) = self . _user_from_str ( user , host_auth , container_auth ) if not valid_user : Msg ( ) . err ( "Error: invalid syntax for user" , user ) return False if self . opt [ "user" ] == "root" : self . opt [ "user" ] = HostInfo ( ) . username ( ) self . opt [ "uid" ] = str ( HostInfo . uid ) self . opt [ "gid" ] = str ( HostInfo . gid ) if ( self . _is_mountpoint ( "/etc/passwd" ) or self . _is_mountpoint ( "/etc/group" ) ) : self . opt [ "hostauth" ] = self . opt [ "containerauth" ] = False return True if self . opt [ "user" ] : self . opt [ "uid" ] = str ( HostInfo . uid ) self . opt [ "gid" ] = str ( HostInfo . gid ) else : if self . opt [ "hostauth" ] or self . opt [ "containerauth" ] : Msg ( ) . err ( "Error: user not found on host" ) return False self . opt [ "user" ] = user_id [ "user" ] if "user" in user_id else user self . opt [ "uid" ] = user_id [ "uid" ] if "uid" in user_id else "" self . opt [ "gid" ] = user_id [ "gid" ] if "gid" in user_id else "" self . _create_user ( container_auth , host_auth ) return True