components/puppet/files/solaris/lib/puppet/type/pkg_publisher.rb
branchs11-update
changeset 3415 e7a2a94a22a2
parent 2771 8e4227dc2fc4
equal deleted inserted replaced
3414:92d170cc406f 3415:e7a2a94a22a2
    18 #
    18 #
    19 # CDDL HEADER END
    19 # CDDL HEADER END
    20 #
    20 #
    21 
    21 
    22 #
    22 #
    23 # Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
    23 # Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
    24 #
    24 #
    25 
    25 
    26 require 'puppet/property/list'
    26 require 'puppet/property/list'
    27 Puppet::Type.newtype(:pkg_publisher) do
    27 Puppet::Type.newtype(:pkg_publisher) do
    28     @doc = "Manage Oracle Solaris package publishers"
    28     @doc = "Manage Oracle Solaris package publishers"
    48             is.sort == self.should.sort
    48             is.sort == self.should.sort
    49         end
    49         end
    50 
    50 
    51         def retrieve
    51         def retrieve
    52             provider.origin
    52             provider.origin
       
    53         end
       
    54 
       
    55         # for origins with a file:// URI, strip any trailing / character
       
    56         munge do |value|
       
    57             if value.start_with? "file" and value.end_with? "/"
       
    58                 value = value.chomp("/")
       
    59             else
       
    60                 value
       
    61             end
    53         end
    62         end
    54     end
    63     end
    55 
    64 
    56     newproperty(:enable) do
    65     newproperty(:enable) do
    57         desc "Enable the publisher"
    66         desc "Enable the publisher"