utils/handsfree/handsfree.py
def add_billing_codes(self):
        '''
        Creates billing codes
        Looks in setup_dir/billing

        Uses the mixcoatl REST utilities:
        1. dcm-post (for adding the billing codes)

        :return: DCM ID for the created billing code.
        '''

        print "{:80}".format("Adding Billing Codes"),
        with open('{}/userkeys.json'.format(self.setup_dir), 'r') as f:
            contents=json.loads(f.read())

        secret_key=contents['secretKey']
        access_key=contents['accessKey']

        os.environ["DCM_ACCESS_KEY"] = access_key
        os.environ["DCM_SECRET_KEY"] = secret_key
        os.environ["DCM_ENDPOINT"] = 'http://{}:15000/api/enstratus/2015-01-28'.format(self.hosts)
        os.environ["DCM_SSL_VERIFY"] = '0'

        for billing_file in os.listdir(self.billing_dir):
            if os.path.isfile(self.billing_dir+'/'+billing_file):
                cmd = "dcm-post admin/BillingCode --json {}".format(self.billing_dir+'/'+billing_file)
                call(cmd, shell=True, stdout=subprocess.PIPE)
        print "{:}".format('[ ' + colored('OK', 'green') + ' ]')

        Creates billing codes
        Looks in setup_dir/billing

        Uses the mixcoatl REST utilities:
        1. dcm-post (for adding the billing codes)

        :return: DCM ID for the created billing code.
        
Creates billing codes
Looks in setup_dir/billing

Uses the mixcoatl REST utilities:
1. dcm-post (for adding the billing codes)
Creates billing codes Looks in setup_dir / billing Uses the mixcoatl REST utilities : 1 . dcm - post ( for adding the billing codes )
def add_billing_codes(self):
        print "{:80}".format("Adding Billing Codes"),
        with open('{}/userkeys.json'.format(self.setup_dir), 'r') as f:
            contents=json.loads(f.read())
        secret_key=contents['secretKey']
        access_key=contents['accessKey']
        os.environ["DCM_ACCESS_KEY"] = access_key
        os.environ["DCM_SECRET_KEY"] = secret_key
        os.environ["DCM_ENDPOINT"] = 'http://{}:15000/api/enstratus/2015-01-28'.format(self.hosts)
        os.environ["DCM_SSL_VERIFY"] = '0'
        for billing_file in os.listdir(self.billing_dir):
            if os.path.isfile(self.billing_dir+'/'+billing_file):
                cmd = "dcm-post admin/BillingCode --json {}".format(self.billing_dir+'/'+billing_file)
                call(cmd, shell=True, stdout=subprocess.PIPE)
        print "{:}".format('[ ' + colored('OK', 'green') + ' ]')
def add_billing_codes ( self ) : print "{:80}" . format ( "Adding Billing Codes" ) , with open ( '{}/userkeys.json' . format ( self . setup_dir ) , 'r' ) as f : contents = json . loads ( f . read ( ) ) secret_key = contents [ 'secretKey' ] access_key = contents [ 'accessKey' ] os . environ [ "DCM_ACCESS_KEY" ] = access_key os . environ [ "DCM_SECRET_KEY" ] = secret_key os . environ [ "DCM_ENDPOINT" ] = 'http://{}:15000/api/enstratus/2015-01-28' . format ( self . hosts ) os . environ [ "DCM_SSL_VERIFY" ] = '0' for billing_file in os . listdir ( self . billing_dir ) : if os . path . isfile ( self . billing_dir + '/' + billing_file ) : cmd = "dcm-post admin/BillingCode --json {}" . format ( self . billing_dir + '/' + billing_file ) call ( cmd , shell = True , stdout = subprocess . PIPE ) print "{:}" . format ( '[ ' + colored ( 'OK' , 'green' ) + ' ]' )
Creates billing codes
Looks in setup_dir/billing
Creates billing codes Looks in setup_dir / billing
'''
        Creates billing codes
        Looks in setup_dir/billing

        Uses the mixcoatl REST utilities:
        1. dcm-post (for adding the billing codes)

        :return: DCM ID for the created billing code.
        '''
DCM ID for the created billing code.
DCM ID for the created billing code .
self