added dummy servers and repos to aid in automated deployments.

This commit is contained in:
brent s 2019-06-05 23:47:26 -04:00
parent 46113be10f
commit dbc4d6c4b1
4 changed files with 23 additions and 5 deletions

View file

@ -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 <server> 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':