コード例 #1
0
ファイル: pods.py プロジェクト: jasonsemko/pygrow
 def get_deployment(self, nickname):
   """Returns a pod-specific deployment."""
   if 'deployments' not in self.yaml:
     raise ValueError('No pod-specific deployments configured.')
   destination_configs = self.yaml['deployments']
   if nickname not in destination_configs:
     text = 'No deployment named {}. Valid deployments: {}.'
     raise ValueError(text.format(nickname, ', '.join(destination_configs.keys())))
   deployment_params = destination_configs[nickname]
   kind = deployment_params.pop('destination')
   try:
     config = destination_configs[nickname]
     deployment = deployments.make_deployment(kind, config, name=nickname)
   except TypeError:
     logging.exception('Invalid deployment parameters.')
     raise
   if deployment.config.keep_control_dir:
     deployment.pod = self
   return deployment
コード例 #2
0
ファイル: pods.py プロジェクト: chargrizzle/pygrow
 def get_deployment(self, nickname):
     """Returns a pod-specific deployment."""
     if "deployments" not in self.yaml:
         raise ValueError("No pod-specific deployments configured.")
     destination_configs = self.yaml["deployments"]
     if nickname not in destination_configs:
         text = "No deployment named {}. Valid deployments: {}."
         keys = ", ".join(destination_configs.keys())
         raise ValueError(text.format(nickname, keys))
     deployment_params = destination_configs[nickname]
     kind = deployment_params.pop("destination")
     try:
         config = destination_configs[nickname]
         deployment = deployments.make_deployment(kind, config, name=nickname)
     except TypeError:
         logging.exception("Invalid deployment parameters.")
         raise
     deployment.pod = self
     return deployment
コード例 #3
0
 def get_deployment(self, nickname):
     """Returns a pod-specific deployment."""
     # Lazy import avoids environment errors and speeds up importing.
     from grow.deployments import deployments
     if 'deployments' not in self.yaml:
         raise ValueError('No pod-specific deployments configured.')
     destination_configs = self.yaml['deployments']
     if nickname not in destination_configs:
         text = 'No deployment named {}. Valid deployments: {}.'
         keys = ', '.join(destination_configs.keys())
         raise ValueError(text.format(nickname, keys))
     deployment_params = destination_configs[nickname]
     kind = deployment_params.pop('destination')
     try:
         config = destination_configs[nickname]
         deployment = deployments.make_deployment(kind, config, name=nickname)
     except TypeError:
         logging.exception('Invalid deployment parameters.')
         raise
     deployment.pod = self
     return deployment
コード例 #4
0
 def get_deployment(self, nickname):
     """Returns a pod-specific deployment."""
     if 'deployments' not in self.yaml:
         raise ValueError('No pod-specific deployments configured.')
     destination_configs = self.yaml['deployments']
     if nickname not in destination_configs:
         text = 'No deployment named {}. Valid deployments: {}.'
         raise ValueError(
             text.format(nickname, ', '.join(destination_configs.keys())))
     deployment_params = destination_configs[nickname]
     kind = deployment_params.pop('destination')
     try:
         config = destination_configs[nickname]
         deployment = deployments.make_deployment(kind,
                                                  config,
                                                  name=nickname)
     except TypeError:
         logging.exception('Invalid deployment parameters.')
         raise
     if deployment.config.keep_control_dir:
         deployment.pod = self
     return deployment
コード例 #5
0
ファイル: pods.py プロジェクト: grow/grow
 def get_deployment(self, nickname):
     """Returns a pod-specific deployment."""
     # Lazy import avoids environment errors and speeds up importing.
     from grow.deployments import deployments
     if 'deployments' not in self.yaml:
         raise ValueError('No pod-specific deployments configured.')
     destination_configs = self.yaml['deployments']
     if nickname not in destination_configs:
         text = 'No deployment named {}. Valid deployments: {}.'
         keys = ', '.join(destination_configs.keys())
         raise ValueError(text.format(nickname, keys))
     deployment_params = destination_configs[nickname]
     kind = deployment_params.pop('destination')
     try:
         config = destination_configs[nickname]
         deployment = deployments.make_deployment(
             kind, config, name=nickname)
     except TypeError:
         logging.exception('Invalid deployment parameters.')
         raise
     deployment.pod = self
     return deployment