Project

General

Profile

Revision c2496839

Added by Thomas McKay over 8 years ago

Checks /api/status for SAM (Headpin)

View differences:

lib/hammer_cli_csv/organizations.rb
37 37
      command_name 'organizations'
38 38
      desc         'import or export organizations'
39 39

  
40
      option %w(--sam), :flag, 'export from SAM-1.3 or SAM-1.4'
41

  
42 40
      LABEL = 'Label'
43 41
      DESCRIPTION = 'Description'
44 42

  
45 43
      def export
46 44
        CSV.open(option_csv_file || '/dev/stdout', 'wb', {:force_quotes => true}) do |csv|
47 45
          csv << [NAME, COUNT, LABEL, DESCRIPTION]
48
          if option_sam?
46

  
47
          if @server_status['release'] == 'Headpin'
49 48
            server = option_server || HammerCLI::Settings.get(:csv, :host)
50 49
            username = option_username || HammerCLI::Settings.get(:csv, :username)
51 50
            password = option_password || HammerCLI::Settings.get(:csv, :password)

Also available in: Unified diff