Class: HammerCLIKatelloBridge::KatelloCommand

Inherits:
HammerCLI::AbstractCommand
  • Object
show all
Defined in:
lib/hammer_cli_katello_bridge.rb

Class Attribute Summary collapse

Instance Method Summary collapse

Class Attribute Details

.command_prefixObject

Returns the value of attribute command_prefix.



12
13
14
# File 'lib/hammer_cli_katello_bridge.rb', line 12

def command_prefix
  @command_prefix
end

Instance Method Details

#executeObject



17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/hammer_cli_katello_bridge.rb', line 17

def execute
  katello_params = options.select { |k,v| k != 'dry_run' }
  safe_params = katello_params.map do |k,v|
    if v.is_a?(TrueClass)
      param = "--#{k}"
    else
      param = "--#{k}='%s'" % v.gsub("'","\\\\'")
    end
    param
  end
  katello [self.class.command_prefix] + safe_params
  0
end