Refactored obtaining stripe plan name to utils.stripe_utils.get_stripe_plan_name

This commit is contained in:
PCoder 2017-09-23 03:17:21 +05:30
parent 3bb7f09d41
commit 285d664660
1 changed files with 12 additions and 1 deletions

View File

@ -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)