(self)
return False
Make sure we have a reasonable default PATH and CWD
Make sure we have a reasonable default PATH and CWD
Make sure we have a reasonable default PATH and CWD
def _check_paths(self):
        """Make sure we have a reasonable default PATH and CWD"""
        if not self.opt["env"].getenv("PATH"):
            if self.opt["uid"] == "0":
                path = Config.conf['root_path']
            else:
                path = Config.conf['user_path']
            self.opt["env"].append("PATH=%s" % path)
        # verify if the working directory is valid and fix it
        if not self.opt["cwd"]:
            self.opt["cwd"] = self.opt["home"]
        cwd_path = FileUtil(self.container_root).cont2host(self.opt["cwd"],
                                                           self.opt["vol"])
        if os.path.isdir(cwd_path):
            return True
        Msg().err("Error: invalid working directory: ", self.opt["cwd"])
        return False
def _check_paths ( self ) : if not self . opt [ "env" ] . getenv ( "PATH" ) : if self . opt [ "uid" ] == "0" : path = Config . conf [ 'root_path' ] else : path = Config . conf [ 'user_path' ] self . opt [ "env" ] . append ( "PATH=%s" % path ) # verify if the working directory is valid and fix it if not self . opt [ "cwd" ] : self . opt [ "cwd" ] = self . opt [ "home" ] cwd_path = FileUtil ( self . container_root ) . cont2host ( self . opt [ "cwd" ] , self . opt [ "vol" ] ) if os . path . isdir ( cwd_path ) : return True Msg ( ) . err ( "Error: invalid working directory: " , self . opt [ "cwd" ] ) return False