Exemplo n.º 1
0
 def __init__(self,
              behaviors,
              role,
              sid=None,
              index=0,
              crypto_key=None,
              farm_hash=None,
              public_ip=None,
              private_ip=None,
              status='pending',
              zone=None):
     """
     @param role: Role object
     @type role: FarmRole
     """
     self.id = sid or str(uuid.uuid4())
     self.index = index
     self.role = role
     self.crypto_key = crypto_key or crypto.keygen()
     self.farm_hash = farm_hash or crypto.keygen(10)
     self.public_ip = public_ip
     self.private_ip = private_ip
     self._status = status
     self.behaviors = behaviors
     self.zone = zone
     self._rootfs_path = None
Exemplo n.º 2
0
 def __init__(self, base_dir=None):
     self._servers = []
     self.event_mgr = events.EventMgr()
     self.queryenv_version = '2012-07-01'
     self.base_dir = base_dir or '.habibi'
     self.RequestHandler.habibi = self
     self.queryenv = QueryEnv(self)
     self.roles = []
     self.farm_crypto_key = crypto.keygen()
     self.started = False