From caedb86aa5331f7de745b0c7022626550cad5d9d Mon Sep 17 00:00:00 2001 From: brent s Date: Wed, 5 Jun 2019 23:56:01 -0400 Subject: [PATCH] some final cleanup --- backup.py | 19 +++++++++---------- plugins/yum_pkgs.py | 2 +- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/backup.py b/backup.py index 96d2998..e0f38ee 100755 --- a/backup.py +++ b/backup.py @@ -42,7 +42,7 @@ loglvls = {'critical': logging.CRITICAL, 'debug': logging.DEBUG} ### DEFAULT NAMESPACE ### -dflt_ns = 'http://git.square-r00t.net/OpTools/tree/storage/backups/borg/' +dflt_ns = 'http://git.square-r00t.net/BorgExtend/tree/storage/backups/borg/' ### THE GUTS ### @@ -255,11 +255,11 @@ class Backup(object): _loc_env['BORG_PASSPHRASE'] = repo['password'] self.logger.info('[{0}]: BEGIN BACKUP: {1}'.format(server, repo['name'])) if 'prep' in repo: - tmpdir = os.path.abspath(os.path.expanduser('~/.cache/.optools_backup')) + tmpdir = os.path.abspath(os.path.expanduser('~/.cache/.borgextend')) os.makedirs(tmpdir, exist_ok = True) os.chmod(tmpdir, mode = 0o0700) for idx, prep in enumerate(repo['prep']): - exec_tmp = tempfile.mkstemp(prefix = '_optools.backup.', + exec_tmp = tempfile.mkstemp(prefix = '_borgextend.', suffix = '._tmpexc', text = True, dir = tmpdir)[1] @@ -284,13 +284,13 @@ class Backup(object): self.logger.debug('Initializing plugin: {0}'.format(plugin)) if repo['plugins'][plugin]['path']: sys.path.insert(1, os.path.abspath(os.path.expanduser(repo['plugins'][plugin]['path']))) - optools_tmpmod = importlib.import_module(plugin, package = None) + borgextend_tmpmod = importlib.import_module(plugin, package = None) if not repo['plugins'][plugin]['params']: - optools_tmpmod.Backup() + borgextend_tmpmod.Backup() else: - optools_tmpmod.Backup(**repo['plugins'][plugin]['params']) + borgextend_tmpmod.Backup(**repo['plugins'][plugin]['params']) del(sys.modules[plugin]) - del(optools_tmpmod) + del(borgextend_tmpmod) sys.path = _orig_path self.logger.debug('Finished plugin: {0}'.format(plugin)) # This is where we actually do the thing. @@ -598,7 +598,7 @@ def parseArgs(): _cfgfile = os.path.abspath( os.path.join(os.path.expanduser('~'), '.config', - 'optools', + 'borgextend', 'backup.xml')) _defloglvl = 'info' ###### @@ -778,8 +778,7 @@ def convertConf(cfgfile): namespaces = {None: dflt_ns, 'xsi': 'http://www.w3.org/2001/XMLSchema-instance'} xsi = {('{http://www.w3.org/2001/' - 'XMLSchema-instance}schemaLocation'): ('http://git.square-r00t.net/OpTools/plain/' - 'storage/backups/borg/config.xsd')} + 'XMLSchema-instance}schemaLocation'): ('http://git.square-r00t.net/BorgExtend/plain/config.xsd')} genname = 'LXML (http://lxml.de/)' root = etree.Element('borg', nsmap = namespaces, attrib = xsi) root.append(etree.Comment(('Generated by {0} on {1} from {2} via {3}').format(sys.argv[0], diff --git a/plugins/yum_pkgs.py b/plugins/yum_pkgs.py index 5346835..f845fb4 100644 --- a/plugins/yum_pkgs.py +++ b/plugins/yum_pkgs.py @@ -18,7 +18,7 @@ except ImportError: import subprocess has_yum = False -# See :/storage/backups/borg/tools/restore_yum_pkgs.py to use the XML file this generates. +# See :/tools/restore_yum_pkgs.py to use the XML file this generates. # Detect RH version.