Sha256: bc85155f23c81542adeb5b31ca89b85f0c2e6fcf9255d249a2d6bd581f2adfdc
Contents?: true
Size: 1.07 KB
Versions: 7
Compression:
Stored size: 1.07 KB
Contents
module ThreeScaleToolbox module Tasks class CopyServiceSettingsTask include CopyTask PARAMS_FILTER = %w[system_name id links] def call svc_obj = update_service source_service_settings if (errors = svc_obj['errors']) raise ThreeScaleToolbox::Error, "Service has not been saved. Errors: #{errors}" \ end puts "updated service settings for service id #{source.id}..." end private def source_service_settings source.attrs.reject { |k, _| PARAMS_FILTER.include? k } end def update_service(service_attrs) svc_obj = target.update service_attrs # Source and target remotes might not allow same set of deployment options # Invalid deployment option check # use default deployment_option if (errors = svc_obj['errors']) && ThreeScaleToolbox::Helper.service_invalid_deployment_option?(errors) service_attrs.delete('deployment_option') svc_obj = target.update service_attrs end svc_obj end end end end
Version data entries
7 entries across 7 versions & 1 rubygems