(self)
Environment variables to set
Environment variables to set
Environment variables to set
def _run_env_set(self):
        """Environment variables to set"""
        self.opt["env"].appendif("HOME=" + self.opt["home"])
        self.opt["env"].append("USER=" + self.opt["user"])
        self.opt["env"].append("LOGNAME=" + self.opt["user"])
        self.opt["env"].append("USERNAME=" + self.opt["user"])

        if str(self.opt["uid"]) == "0":
            self.opt["env"].append(r"PS1=%s# " % self.container_id[:8])
        else:
            self.opt["env"].append(r"PS1=%s\$ " % self.container_id[:8])

        self.opt["env"].append("SHLVL=0")
        self.opt["env"].append("container_ruser=" + HostInfo().username())
        self.opt["env"].append("container_root=" + self.container_root)
        self.opt["env"].append("container_uuid=" + self.container_id)
        self.opt["env"].append("container_execmode=" +
                               self.exec_mode.get_mode())
        cont_name = self.container_names
        # if Python 3
        if sys.version_info[0] >= 3:
            names = str(cont_name).translate(str.maketrans('', '', " '\"[]"))
        else:
            names = str(cont_name).translate(None, " '\"[]")

        self.opt["env"].append("container_names=" + names)
def _run_env_set ( self ) : self . opt [ "env" ] . appendif ( "HOME=" + self . opt [ "home" ] ) self . opt [ "env" ] . append ( "USER=" + self . opt [ "user" ] ) self . opt [ "env" ] . append ( "LOGNAME=" + self . opt [ "user" ] ) self . opt [ "env" ] . append ( "USERNAME=" + self . opt [ "user" ] ) if str ( self . opt [ "uid" ] ) == "0" : self . opt [ "env" ] . append ( r"PS1=%s# " % self . container_id [ : 8 ] ) else : self . opt [ "env" ] . append ( r"PS1=%s\$ " % self . container_id [ : 8 ] ) self . opt [ "env" ] . append ( "SHLVL=0" ) self . opt [ "env" ] . append ( "container_ruser=" + HostInfo ( ) . username ( ) ) self . opt [ "env" ] . append ( "container_root=" + self . container_root ) self . opt [ "env" ] . append ( "container_uuid=" + self . container_id ) self . opt [ "env" ] . append ( "container_execmode=" + self . exec_mode . get_mode ( ) ) cont_name = self . container_names # if Python 3 if sys . version_info [ 0 ] >= 3 : names = str ( cont_name ) . translate ( str . maketrans ( '' , '' , " '\"[]" ) ) else : names = str ( cont_name ) . translate ( None , " '\"[]" ) self . opt [ "env" ] . append ( "container_names=" + names )