def run(): print "Exiting program, cleaning files." cleanup.run() while(True): try: verify.run() print "Verified files, everything is here." break except ValueError: print "Check dirContents against directory to verify missing files." exit(1)
def conc_cache_cleanup(ttl, subdir, dry_run): return run( root_dir=self._cache_dir, corpus_id=None, ttl=ttl, subdir=subdir, dry_run=dry_run, db_plugin=self._db, entry_key_gen=lambda c: RedisCacheMapping.KEY_TEMPLATE % c)
def scriptrunner(scripttype, logfile, arch="no_arch"): """ Chooses and runs an installation script, and supplies the logfile that the script will write its output to. Though not all scripts are OS-dependent, the "arch" parameter is used to determine if the system is supported. Parameters: 1. scripttype: The installation script that is being run. Supported values: "dependencies", "cleanup", "pip", "initialize_instance", "update_instance" 2. logfile: The log file to pass to the installation script. 3. arch: Architecture. RHEL / CentOS are supported for x86 and x64 architectures. The "dependencies" option requires x86 or x64 to be specified. The default value is "no_arch". """ if (arch == "x86" or arch == "x64" or arch == "no_arch"): if scripttype == "dependencies" and (arch == "x86" or arch == "x64"): logfile = redhat.dependency_redhat.run(arch, logfile) elif scripttype == "dependencies" and arch == "no_arch": logfile.write("No architecture specified for dependencies.") logfile.write("Script could not be completed.\n") print "No architecture specified for dependencies." print "Script could not be completed.\n" elif (scripttype in ["cleanup", "pip", "initialize_instance", "update_instance"]): if (arch == "x86" or arch == "x64"): print("%s script is x86 and x64-compatible." % scripttype) # Run one of the architecture-independent scripts if scripttype == "cleanup": logfile = cleanup.run(logfile) elif scripttype == "pip": logfile = pip_install.run(logfile) elif scripttype == "initialize_instance": logfile = run_initialize_instance.run(logfile) elif scripttype == "update_instance": logfile = run_update_instance.run(logfile) else: logfile.write( "Error: redhat_installer.py invoked with invalid command: %s\n" % scripttype) print "Error: redhat_installer.py invoked with invalid command: %s" % scripttype else: logfile.write("Unsupported architecture for RHEL / CentOS: %s\n" % arch) logfile.write("Script could not be completed.\n") print "Unsupported architecture for RHEL / CentOS: %s" % arch print "Script could not be completed." # After the function is done, return the logfile. return logfile
def scriptrunner(scripttype, logfile, arch="no_arch"): """ Chooses and runs an installation script, and supplies the logfile that the script will write its output to. Though not all scripts are OS-dependent, the "arch" parameter is used to determine if the system is supported. Parameters: 1. scripttype: The installation script that is being run. Supported values: "dependencies", "cleanup", "pip", "initialize_instance", "update_instance" 2. logfile: The log file to pass to the installation script. 3. arch: Architecture. Ubuntu is supported for x86 and x64 architectures. The "dependencies" option requires x86 or x64 to be specified. The default value is "no_arch". """ if (arch == "x86" or arch == "x64" or arch == "no_arch"): if scripttype == "dependencies" and (arch == "x86" or arch == "x64"): logfile = ubuntu.dependency_ubuntu.run(arch, logfile) elif scripttype == "dependencies" and arch == "no_arch": logfile.write("No architecture specified for dependencies.") logfile.write("Script could not be completed.\n") print "No architecture specified for dependencies." print "Script could not be completed.\n" elif (scripttype in ["cleanup","pip","initialize_instance","update_instance"]): if (arch == "x86" or arch == "x64"): print ("%s script is x86 and x64-compatible." % scripttype) # Run one of the architecture-independent scripts if scripttype == "cleanup": logfile = cleanup.run(logfile) elif scripttype == "pip": logfile = pip_install.run(logfile) elif scripttype == "initialize_instance": logfile = run_initialize_instance.run(logfile) elif scripttype == "update_instance": logfile = run_update_instance.run(logfile) else: logfile.write("Error: ubuntu_installer.py invoked with invalid command: %s\n" % scripttype) print "Error: ubuntu_installer.py invoked with invalid command: %s\n" % scripttype else: logfile.write("Unsupported architecture for Ubuntu: %s\n" % arch) logfile.write("Script could not be completed.\n") print "Unsupported architecture for Ubuntu: %s\n" % arch print "Script could not be completed.\n" # After the function is done, return the logfile. return logfile
def coalesceSR(self, sr): cleanup.run(sr, "lvhd", None, True, False, True, False)
def run(event, context): cleanup.run()
def run(): setup() set_rancher_token_url() start() testbench.run() cleanup.run()
def conc_cache_cleanup(ttl, subdir, dry_run): from plugins.default_conc_cache import CacheMapping return run(root_dir=self._cache_dir, corpus_id=None, ttl=ttl, subdir=subdir, dry_run=dry_run, cache_map_filename=CacheMapping.CACHE_FILENAME, locking_plugin=self._lock_factory)