From dbc4d6c4b1926bf8e91c110f36b6169b9017424e Mon Sep 17 00:00:00 2001 From: brent s Date: Wed, 5 Jun 2019 23:47:26 -0400 Subject: [PATCH] added dummy servers and repos to aid in automated deployments. --- backup.py | 6 ++++++ config.xsd | 6 ++++++ sample.config.snippet.xml | 4 +++- sample.config.xml | 12 ++++++++---- 4 files changed, 23 insertions(+), 5 deletions(-) diff --git a/backup.py b/backup.py index 4c261ed..96d2998 100755 --- a/backup.py +++ b/backup.py @@ -127,6 +127,8 @@ class Backup(object): for repo in server.findall('{0}repo'.format(self.ns)): if reponames and repo.attrib['name'] not in reponames: continue + if repo.attrib.get('dummy', 'false').lower()[0] in ('1', 't'): + continue r = {} for a in repo.attrib: r[a] = repo.attrib[a] @@ -163,6 +165,8 @@ class Backup(object): if 'all' in self.args['server']: self.args['server'] = [] for server in self.cfg.findall('{0}server'.format(self.ns)): + if server.attrib.get('dummy', 'false').lower()[0] in ('1', 't'): + continue # The server elements are uniquely constrained to the "target" attrib. # *NO TWO ELEMENTS WITH THE SAME target= SHOULD EXIST.* self.args['server'].append(server.attrib['target']) @@ -170,6 +174,8 @@ class Backup(object): sname = server.attrib['target'] if sname not in self.args['server']: continue + if server.attrib.get('dummy', 'false').lower()[0] in ('1', 't'): + continue self.repos[sname] = {} for x in server.attrib: if x != 'target': diff --git a/config.xsd b/config.xsd index 946e1cd..25d0130 100644 --- a/config.xsd +++ b/config.xsd @@ -93,6 +93,9 @@ be interactively (and securely) prompted for. --> + + @@ -112,6 +115,9 @@ + + diff --git a/sample.config.snippet.xml b/sample.config.snippet.xml index 55788c8..107342a 100644 --- a/sample.config.snippet.xml +++ b/sample.config.snippet.xml @@ -1,2 +1,4 @@ - /abc + + /dev/null + \ No newline at end of file diff --git a/sample.config.xml b/sample.config.xml index e2db783..74507c9 100644 --- a/sample.config.xml +++ b/sample.config.xml @@ -8,20 +8,21 @@ + "user" = (remote host only) the ssh user to use. + "dummy" = a boolean; if you need to create a "dummy" server, set this to "true". + It will *not* be parsed or executed upon. + It won't even be created by an init operation or show up in a repolist operation. --> /a - - /a/b @@ -73,5 +74,8 @@ + +