def main(self): if self.a.install: i = Install() i.install() if self.a.uninstall: i = Install() i.uninstall() exit("Uninstall Complete") if not self.a.filename: self.a.filename = "passwords.txt" if self.a.ssid or self.a.password: self.add_to_list(self.a.filename, self.a.ssid, self.a.password) w = Wifi()
def __check_install_fun(self): # 调用checkInstall函数 检查是否初始化 if Install().check_install(): # print('执行项目Test') self.__unittest_init() else: print('初始化完成')
def _run_upgrade(self): self._logger.info("hooks: %s" % self._options.skip_existing_hooks) self._python_lib = glob.glob("%s/rootfs/usr/lib/python*" % self._tmp_dir) if not self._python_lib: raise RuntimeError("Unable to determine python path") self._python_lib = self._python_lib[0] self._tmp_python_path = "%s/site-packages/ovirtnode" \ % self._python_lib shutil.copytree(self._tmp_python_path, self._ovirtnode_dir) # import install and ovirtfunctions modules from new image f, filename, description = imp.find_module( 'install', [self._ovirtnode_dir], ) install = imp.load_module( 'install', f, filename, description, ) # log module detail for debugging self._logger.debug(install) from install import Install upgrade = Install() self._logger.propagate = True self._logger.info("Installing Bootloader") if not upgrade.ovirt_boot_setup(): raise RuntimeError("Bootloader Installation Failed")
def __init__(self, answers, APP, dryrun=False, debug=False, stop=False, answers_format=ANSWERS_FILE_SAMPLE_FORMAT, **kwargs): self.debug = debug self.dryrun = dryrun self.stop = stop self.kwargs = kwargs if "answers_output" in kwargs: self.answers_output = kwargs["answers_output"] if os.environ and "IMAGE" in os.environ: self.app_path = APP APP = os.environ["IMAGE"] del os.environ["IMAGE"] elif "image" in kwargs: logger.warning("Setting image to %s" % kwargs["image"]) self.app_path = APP APP = kwargs["image"] del kwargs["image"] self.kwargs = kwargs if APP and os.path.exists(APP): self.app_path = APP else: if not self.app_path: self.app_path = os.getcwd() install = Install(answers, APP, dryrun=dryrun, target_path=self.app_path, answers_format=answers_format) install.install() printStatus("Install Successful.") self.nulecule_base = Nulecule_Base(target_path=self.app_path, dryrun=dryrun, file_format=answers_format) if "ask" in kwargs: self.nulecule_base.ask = kwargs["ask"] workdir = None if "workdir" in kwargs: workdir = kwargs["workdir"] self.utils = Utils(self.app_path, workdir) if "workdir" not in kwargs: kwargs["workdir"] = self.utils.workdir self.answers_file = answers self.plugin = Plugin() self.plugin.load_plugins()
def setUp(self): self.install = Install()
# -------------------------------- Procedural -------------------------------- args = processArguments() if args.version: # prints program legal / dev / version info print("Current Version: " + VERSION) print("Author: K4YT3X") print("License: GNU GPL v3") print("Github Page: https://github.com/K4YT3X/DefenseMatrix") print("Contact: [email protected]") print() exit(0) if os.getuid() != 0: avalon.error("This app requires root privilege to run!") exit(0) try: if args.install: installer = Install() installer.install() elif args.uninstall: uninstaller = Install() uninstaller.uninstall() elif args.audit: securityAudit.audit() except KeyboardInterrupt: avalon.warning("Aborting")