mirror of
https://github.com/kevingruesser/bootstrap-vz.git
synced 2025-08-24 15:36:27 +00:00
(g|s)etstate for manifest
This commit is contained in:
parent
aa9616f4a6
commit
150b15bb4f
3 changed files with 18 additions and 6 deletions
|
@ -86,8 +86,7 @@ def setup_loggers(opts):
|
||||||
|
|
||||||
|
|
||||||
def run(manifest, debug=False, pause_on_error=False, dry_run=False):
|
def run(manifest, debug=False, pause_on_error=False, dry_run=False):
|
||||||
log.info('test')
|
return manifest
|
||||||
return 'derp'
|
|
||||||
"""Runs the bootstrapping process
|
"""Runs the bootstrapping process
|
||||||
|
|
||||||
:params Manifest manifest: The manifest to run the bootstrapping process for
|
:params Manifest manifest: The manifest to run the bootstrapping process for
|
||||||
|
|
|
@ -15,6 +15,7 @@ class Manifest(object):
|
||||||
Currently, immutability is not enforced and it would require a fair amount of code
|
Currently, immutability is not enforced and it would require a fair amount of code
|
||||||
to enforce it, instead we just rely on tasks behaving properly.
|
to enforce it, instead we just rely on tasks behaving properly.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
def __init__(self, path=None, data=None):
|
def __init__(self, path=None, data=None):
|
||||||
"""Initializer: Given a path we load, validate and parse the manifest.
|
"""Initializer: Given a path we load, validate and parse the manifest.
|
||||||
To create the manifest from dynamic data instead of the contents of a file,
|
To create the manifest from dynamic data instead of the contents of a file,
|
||||||
|
@ -130,3 +131,14 @@ class Manifest(object):
|
||||||
:raises ManifestError: With absolute certainty
|
:raises ManifestError: With absolute certainty
|
||||||
"""
|
"""
|
||||||
raise ManifestError(message, self.path, data_path)
|
raise ManifestError(message, self.path, data_path)
|
||||||
|
|
||||||
|
def __getstate__(self):
|
||||||
|
return {'path': self.path,
|
||||||
|
'data': self.data}
|
||||||
|
|
||||||
|
def __setstate__(self, vals):
|
||||||
|
self.path = vals.path
|
||||||
|
self.load(vals.data)
|
||||||
|
self.initialize()
|
||||||
|
self.validate()
|
||||||
|
self.parse()
|
||||||
|
|
|
@ -34,10 +34,11 @@ def main():
|
||||||
server = manager.rpc_server
|
server = manager.rpc_server
|
||||||
|
|
||||||
# Everything has been set up, begin the bootstrapping process
|
# Everything has been set up, begin the bootstrapping process
|
||||||
server.run(None,
|
ret = server.run(manifest,
|
||||||
debug=opts['--debug'],
|
debug=opts['--debug'],
|
||||||
pause_on_error=False,
|
pause_on_error=False,
|
||||||
dry_run=opts['--dry-run'])
|
dry_run=opts['--dry-run'])
|
||||||
|
logging.getLogger(__name__).info(ret)
|
||||||
finally:
|
finally:
|
||||||
manager.stop()
|
manager.stop()
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue