Ejemplo n.º 1
0
 def get_cluster(self, cluster_name: str = None):
     if cluster_name is None:
         cluster_name = self.default_cluster
     if cluster_name not in self.clusters:
         raise RuntimeError(
             f'No configuration found for cluster {cluster_name}')
     return get_cluster_provider(**self.get(f'clusters.{cluster_name}'))
Ejemplo n.º 2
0
def env_get_cluster_provider():
    if ENV_TASK_CLUSTER not in os.environ:
        raise ValueError(
            f'Cluster provider must be passed in the '
            f'{ENV_TASK_CLUSTER} environment variable.')

    provider_json = json.loads(os.environ[ENV_TASK_CLUSTER])
    return get_cluster_provider(**provider_json)
Ejemplo n.º 3
0
def env_get_cluster_provider():
    clusterdef = env_get(ENV_TASK_CLUSTER)
    return get_cluster_provider(**clusterdef)
Ejemplo n.º 4
0
 def get_cluster(self, cluster_name: str = None):
     if cluster_name not in self.clusters:
         raise RuntimeError(
             f'No configuration found for cluster {cluster_name}')
     return get_cluster_provider(**self.clusters[cluster_name])