Helper method to associate the stage_name to the given deploymentId and make this current

def _set_current_deployment(self, stage_desc_json, stage_variables):
        '''
        Helper method to associate the stage_name to the given deploymentId and make this current
        '''
        stage = __salt__['boto_apigateway.describe_api_stage'](restApiId=self.restApiId,
                                                               stageName=self._stage_name,
                                                               **self._common_aws_args).get('stage')
        if not stage:
            stage = __salt__['boto_apigateway.create_api_stage'](restApiId=self.restApiId,
                                                                 stageName=self._stage_name,
                                                                 deploymentId=self._deploymentId,
                                                                 description=stage_desc_json,
                                                                 variables=stage_variables,
                                                                 **self._common_aws_args)
            if not stage.get('stage'):
                return {'set': False, 'error': stage.get('error')}
        else:
            # overwrite the stage variables
            overwrite = __salt__['boto_apigateway.overwrite_api_stage_variables'](restApiId=self.restApiId,
                                                                                  stageName=self._stage_name,
                                                                                  variables=stage_variables,
                                                                                  **self._common_aws_args)
            if not overwrite.get('stage'):
                return {'set': False, 'error': overwrite.get('error')}

        return __salt__['boto_apigateway.activate_api_deployment'](restApiId=self.restApiId,
                                                                   stageName=self._stage_name,
                                                                   deploymentId=self._deploymentId,
                                                                   **self._common_aws_args)