示例#1
0
 def create(cls, user, base):
     if cls.exists(user):
         logging.warning("User `%s' already exists ..." % user)
         return False
     p = Popen(
         ["useradd", "-r", "-s", "/bin/sh", "-d", base, "-m", "-U", user])
     p.wait()
示例#2
0
 def _createDirectoryStructure(self, repo, tar, ssh):
     if not path.exists(repo):
         logging.info("Creating repository dir at `%s' ..." % repo)
         mkdir(repo)
     else:
         logging.warning("The folder `%s' already exists." % repo)
     Config.set("phoenix", "repository_dir", repo)
     
     if not path.exists(tar):
         logging.info("Creating tarball dir at `%s' ..." % tar)
         mkdir(tar)
     else:
         logging.warning("The folder `%s' already exists." % tar)
     Config.set("phoenix", "tarball_dir", tar)
     
     if not path.exists(ssh):
         logging.info("Creating ssh dir at `%s' ..." % ssh)
         mkdir(ssh, 0700)
     else:
         logging.warning("The folder `%s' already exists." % ssh)
     Config.set("phoenix", "ssh_dir", ssh)
示例#3
0
    def _createDirectoryStructure(self, repo, tar, ssh):
        if not path.exists(repo):
            logging.info("Creating repository dir at `%s' ..." % repo)
            mkdir(repo)
        else:
            logging.warning("The folder `%s' already exists." % repo)
        Config.set("phoenix", "repository_dir", repo)

        if not path.exists(tar):
            logging.info("Creating tarball dir at `%s' ..." % tar)
            mkdir(tar)
        else:
            logging.warning("The folder `%s' already exists." % tar)
        Config.set("phoenix", "tarball_dir", tar)

        if not path.exists(ssh):
            logging.info("Creating ssh dir at `%s' ..." % ssh)
            mkdir(ssh, 0700)
        else:
            logging.warning("The folder `%s' already exists." % ssh)
        Config.set("phoenix", "ssh_dir", ssh)
示例#4
0
 def create(cls, user, base):
     if cls.exists(user):
         logging.warning("User `%s' already exists ..." % user)
         return False
     p = Popen(["useradd", "-r", "-s", "/bin/sh", "-d", base, "-m", "-U", user])
     p.wait()