From 285d66466052f84ac5348f3fd1582c60556108ed Mon Sep 17 00:00:00 2001 From: PCoder Date: Sat, 23 Sep 2017 03:17:21 +0530 Subject: [PATCH] Refactored obtaining stripe plan name to utils.stripe_utils.get_stripe_plan_name --- utils/stripe_utils.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/utils/stripe_utils.py b/utils/stripe_utils.py index f35a6b9c..cb4f6eff 100644 --- a/utils/stripe_utils.py +++ b/utils/stripe_utils.py @@ -238,7 +238,7 @@ class StripeUtils(object): @staticmethod def get_stripe_plan_id(cpu, ram, ssd, version, app='dcl', hdd=None): """ - Returns the stripe plan id string of the form + Returns the Stripe plan id string of the form `dcl-v1-cpu-2-ram-5gb-ssd-10gb` based on the input parameters :param cpu: The number of cores @@ -260,3 +260,14 @@ class StripeUtils(object): version=version, plan=dcl_plan_string) return stripe_plan_id_string + + @staticmethod + def get_stripe_plan_name(cpu, memory, disk_size): + """ + Returns the Stripe plan name + :return: + """ + return "{cpu} Cores, {memory} GB RAM, {disk_size} GB SSD".format( + cpu=cpu, + memory=memory, + disk_size=disk_size)