class RHN::Configchannel

Public Class Methods

copyPath(cf) click to toggle source

Class Methods Remove fields not needed for creation from config file

# File lib/satops/rhsat.rb, line 246
def self.copyPath(cf)
  perms=cf["permissions_mode"]
  cf.delete_if { |k,v| k=="modified" || k=="creation" || k=="binary" || k=="channel" || k=="md5" || k=="path" || k=="type" || k == "permissions_mode" || k == "permissions" }
  cf.merge({ "permissions"=> perms.to_s })
end
new(sat) click to toggle source
Calls superclass method RHN::Operation::new
# File lib/satops/rhsat.rb, line 227
def initialize(sat)
  super(sat)
  define 'configchannel.channelExists'
  define 'configchannel.create'
  define 'configchannel.deleteChannels'
  define 'configchannel.deleteFiles'
  define 'configchannel.deleteFileRevisions'
  define 'configchannel.getDetails'
  define 'configchannel.getFileRevision'
  define 'configchannel.getFileRevisions'
  define 'configchannel.listFiles', :list
  define 'configchannel.listGlobals', :list
  define 'configchannel.listSubscribedSystems', :list
  define 'configchannel.lookupFileInfo'
  define 'configchannel.update'
end

Public Instance Methods

createOrUpdatePath(label, file, type) click to toggle source
# File lib/satops/rhsat.rb, line 252
def createOrUpdatePath(label, file, type)
  # Type is boolean : false is file, true is Directory
  path=file['path']
  if type
    file_type='directory'
  else
    file_type='file'
  end
  name="configchannel:createOrUpdatePath"
  result=@sat.run('configchannel.createOrUpdatePath', label, file['path'], type, Configchannel.copyPath(file))
  if result
    trace_info(name, label, path)
  else
    case @sat.exception.faultCode
    when 1023
      trace_warn(name, 'Existing', label, path)
    else
      trace_warn(name, 'KO', label, path, @sat.get_exception)
    end
  end
end
exist?(cfg_channel) click to toggle source
# File lib/satops/rhsat.rb, line 289
def exist?(cfg_channel)
  if @sat.run('configchannel.channelExists', cfg_channel['label']) == 1
    return true
  else
    return false
  end
end