def create_update_resource(self):
    try:
        if (self.to_do == Actions.Create):
            response = self.mgmt_client.query(self.url, 'PUT', self.query_parameters, self.header_parameters, self.body, self.status_code, 600, 30)
        else:
            response = self.mgmt_client.query(self.url, 'PUT', self.query_parameters, self.header_parameters, self.body, self.status_code, 600, 30)
    except CloudError as exc:
        self.log('Error attempting to create the SubscriptionFactory instance.')
        self.fail('Error creating the SubscriptionFactory instance: {0}'.format(str(exc)))
    try:
        response = json.loads(response.text)
    except Exception:
        response = {'text': response.text}
        pass
    return response
def create_update_resource(self):
    try:
        if (self.to_do == Actions.Create):
            response = self.mgmt_client.query(self.url, 'PUT', self.query_parameters, self.header_parameters, self.body, self.status_code, 600, 30)
        else:
            response = self.mgmt_client.query(self.url, 'PUT', self.query_parameters, self.header_parameters, self.body, self.status_code, 600, 30)
    except CloudError as exc:
        self.log('Error attempting to create the SubscriptionFactory instance.')
        self.fail('Error creating the SubscriptionFactory instance: {0}'.format(str(exc)))
    try:
        response = json.loads(response.text)
    except Exception:
        response = {'text': response.text}
        pass
    return response