Advertisement
Guest User

Untitled

a guest
Sep 1st, 2016
60
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.10 KB | None | 0 0
  1. @classmethod
  2. def setUpClass(cls):
  3. """Read the bundle in and deploy the bundle."""
  4. # Get the relative bundle path from the environment variable.
  5. cls.bundle = os.getenv('BUNDLE', 'bundle.yaml')
  6. # Create a path to the bundle based on this file's location.
  7. cls.bundle_path = os.path.join(os.path.dirname(__file__),
  8. '..',
  9. cls.bundle)
  10. # Normalize the path to the bundle.
  11. cls.bundle_path = os.path.abspath(cls.bundle_path)
  12.  
  13. print('Deploying bundle: {0}'.format(cls.bundle_path))
  14.  
  15. cls.deployment = amulet.Deployment()
  16. with open(cls.bundle_path, 'r') as bundle_file:
  17. contents = yaml.safe_load(bundle_file)
  18. cls.deployment.load(contents)
  19.  
  20. # Allow some time for Juju to provision and deploy the bundle.
  21. cls.deployment.setup(timeout=SECONDS_TO_WAIT)
  22. # Wait for the system to settle down.
  23. cls.deployment.sentry.wait()
  24.  
  25. cls.k8s = cls.deployment.sentry['kubernetes']
  26. cls.etcd = cls.deployment.sentry['etcd']
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement