Beispiel #1
0
def rmdirs(path):
    if os.path.isdir(path):
        if len(path) < 20 and 'home' in path:
            LOG.error('Refusing to rm {!r} since it might be your homedir.'.format(path))
            return
        cmd = 'rm -rf {}'.format(path)
        system(cmd)
Beispiel #2
0
def rmdirs(path):
    if os.path.isdir(path):
        if len(path) < 20 and 'home' in path:
            LOG.error(
                'Refusing to rm {!r} since it might be your homedir.'.format(
                    path))
            return
        cmd = 'rm -rf {}'.format(path)
        system(cmd)
Beispiel #3
0
    def system(self, cmd, ignore_error=False, frame=None):
        """
        A convinience method for calling io.system().  Shell out
        to the given command and wait for it to finish.

        @see: L{io.system}

        @type  cmd: list<str>
        @param cmd: The command to execute.

        @type ignore_error: boolean
        @param ignore_error: Ignore any L{OSError} or shell command failures.
        """
        io.system(cmd, ignore_error, frame)
Beispiel #4
0
def main(argv):

    bind9.install()
    
    answer = False
    print "Run apt-get update? (y/N):"
    ans = sys.stdin.readline()
    if ans.startswith("y"):
        io.system("apt-get update")

    print "Run apt-get upgrade? (y/N):"
    ans = sys.stdin.readline()
    if ans.startswith("y"):
        io.system("apt-get upgrade -y")
    
    print "Install and configure bind9? (y/N):"
    ans = sys.stdin.readline()
    if ans.startswith("y"):
        bind9.install()
Beispiel #5
0
def run(script_fn):
    cwd, basename = os.path.split(script_fn)
    with cd(cwd):
        system('/bin/bash {}'.format(basename))
Beispiel #6
0
 def system(self, cmd):
     system(cmd)
Beispiel #7
0
def run(script_fn):
    cwd, basename = os.path.split(script_fn)
    with cd(cwd):
        system('/bin/bash {}'.format(basename))
Beispiel #8
0
 def system(self, cmd):
     system(cmd)