Refactored obtaining stripe plan name to utils.stripe_utils.get_stripe_plan_name
This commit is contained in:
		
					parent
					
						
							
								3bb7f09d41
							
						
					
				
			
			
				commit
				
					
						285d664660
					
				
			
		
					 1 changed files with 12 additions and 1 deletions
				
			
		| 
						 | 
					@ -238,7 +238,7 @@ class StripeUtils(object):
 | 
				
			||||||
    @staticmethod
 | 
					    @staticmethod
 | 
				
			||||||
    def get_stripe_plan_id(cpu, ram, ssd, version, app='dcl', hdd=None):
 | 
					    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
 | 
					        `dcl-v1-cpu-2-ram-5gb-ssd-10gb` based on the input parameters
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        :param cpu: The number of cores
 | 
					        :param cpu: The number of cores
 | 
				
			||||||
| 
						 | 
					@ -260,3 +260,14 @@ class StripeUtils(object):
 | 
				
			||||||
                                                                 version=version,
 | 
					                                                                 version=version,
 | 
				
			||||||
                                                                 plan=dcl_plan_string)
 | 
					                                                                 plan=dcl_plan_string)
 | 
				
			||||||
        return stripe_plan_id_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)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue