libraries/resource_provider.rb
def replace_scopes
      return Chef::Log.info('No scopes were specified to perform replace_scopes. Skipping') if @new_resource.scopes.nil?
      raise "ResourceNotFound: #{@resource_name} '#{@name}' does not exist" unless @item.retrieve!
      scopes = @new_resource.scopes.map { |scope_name| load_resource(:Scope, scope_name) }
      scope_uris = scopes.map { |scope| scope['uri'] }
      if @item['scopeUris'].sort == scope_uris.sort
        return Chef::Log.info("Scopes '#{@new_resource.scopes}' already are scopes of #{@resource_name} '#{@name}'. Skipping")
      end
      @context.converge_by "Replaced Scopes '#{@new_resource.scopes.sort}' for #{@resource_name} '#{@name}'" do
        @item.replace_scopes(scopes)
      end
    end
# Replaces scopes to the Oneview resource
Replaces scopes to the Oneview resource
Replaces scopes to the Oneview resource
def replace_scopes
      return Chef::Log.info('No scopes were specified to perform replace_scopes. Skipping') if @new_resource.scopes.nil?
      raise "ResourceNotFound: #{@resource_name} '#{@name}' does not exist" unless @item.retrieve!
      scopes = @new_resource.scopes.map { |scope_name| load_resource(:Scope, scope_name) }
      scope_uris = scopes.map { |scope| scope['uri'] }
      if @item['scopeUris'].sort == scope_uris.sort
        return Chef::Log.info("Scopes '#{@new_resource.scopes}' already are scopes of #{@resource_name} '#{@name}'. Skipping")
      end
      @context.converge_by "Replaced Scopes '#{@new_resource.scopes.sort}' for #{@resource_name} '#{@name}'" do
        @item.replace_scopes(scopes)
      end
    end
def replace_scopes return Chef :: Log . info ( 'No scopes were specified to perform replace_scopes. Skipping' ) if @new_resource . scopes . nil? raise "ResourceNotFound: #{@resource_name} '#{@name}' does not exist" unless @item . retrieve! scopes = @new_resource . scopes . map { | scope_name | load_resource ( :Scope , scope_name ) } scope_uris = scopes . map { | scope | scope [ 'uri' ] } if @item [ 'scopeUris' ] . sort == scope_uris . sort return Chef :: Log . info ( "Scopes '#{@new_resource.scopes}' already are scopes of #{@resource_name} '#{@name}'. Skipping" ) end @context . converge_by "Replaced Scopes '#{@new_resource.scopes.sort}' for #{@resource_name} '#{@name}'" do @item . replace_scopes ( scopes ) end end
Replaces scopes to the Oneview resource
Replaces scopes to the Oneview resource