Skip to content
This repository has been archived by the owner on Feb 3, 2021. It is now read-only.

Commit

Permalink
Fix: --size-low-pri being ignored (#593)
Browse files Browse the repository at this point in the history
  • Loading branch information
timotheeguerin authored Jun 5, 2018
1 parent 3f0c8f9 commit fa3ac0e
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions aztk_cli/spark/endpoints/cluster/cluster_create.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

import aztk.spark
from aztk.spark.models import ClusterConfiguration, UserConfiguration
from aztk.utils import deprecate
from aztk_cli import config, log, utils
from aztk_cli.config import load_aztk_spark_config

Expand All @@ -13,6 +14,8 @@ def setup_parser(parser: argparse.ArgumentParser):
parser.add_argument('--size', type=int,
help='Number of vms in your cluster')
parser.add_argument('--size-low-pri', type=int,
help='Number of low priority vms in your cluster (Deprecated, use --size-low-priority)')
parser.add_argument('--size-low-priority', type=int,
help='Number of low priority vms in your cluster')
parser.add_argument('--vm-size',
help='VM size for nodes in your cluster')
Expand All @@ -29,17 +32,21 @@ def setup_parser(parser: argparse.ArgumentParser):

parser.add_argument('--no-wait', dest='wait', action='store_false')
parser.add_argument('--wait', dest='wait', action='store_true')
parser.set_defaults(wait=None, size=None, size_low_priority=None)
parser.set_defaults(wait=None, size=None, size_low_pri=None, size_low_priority=None)


def execute(args: typing.NamedTuple):
spark_client = aztk.spark.Client(config.load_aztk_secrets())
cluster_conf = ClusterConfiguration()
cluster_conf.spark_configuration = load_aztk_spark_config()

# read cluster.yaml configuartion file, overwrite values with args
# read cluster.yaml configuration file, overwrite values with args
file_config, wait = config.read_cluster_config()
cluster_conf.merge(file_config)
if args.size_low_pri is not None:
deprecate("--size-low-pri has been deprecated. Please use --size-low-priority")
args.size_low_priority = args.size_low_pri

cluster_conf.merge(ClusterConfiguration(
cluster_id=args.cluster_id,
size=args.size,
Expand Down

0 comments on commit fa3ac0e

Please sign in to comment.