Sha256: e71224f795e8d48e9f826b907e65f68543d061e27233241873e882360d60e4c3

Contents?: true

Size: 1.93 KB

Versions: 11

Compression:

Stored size: 1.93 KB

Contents

module HammerCLIForeman

  class PartitionTable < HammerCLIForeman::Command

    resource :ptables

    class ListCommand < HammerCLIForeman::ListCommand

      output do
        field :id, _("Id")
        field :name, _("Name")
        field :os_family, _("OS Family")
      end

      build_options
    end


    class InfoCommand < HammerCLIForeman::InfoCommand
      output ListCommand.output_definition do
        HammerCLIForeman::References.operating_systems(self)
        HammerCLIForeman::References.timestamps(self)
      end

      build_options
    end


    class DumpCommand < HammerCLIForeman::InfoCommand
      command_name "dump"
      desc _("View partition table content.")

      def print_data(partition_table)
        puts partition_table["layout"]
      end

      build_options
    end


    class CreateCommand < HammerCLIForeman::CreateCommand

      option "--file", "LAYOUT", _("Path to a file that contains the partition layout"), :attribute_name => :option_layout,
        :required => true, :format => HammerCLI::Options::Normalizers::File.new

      success_message _("Partition table created")
      failure_message _("Could not create the partition table")

      build_options :without => [:layout]
    end


    class UpdateCommand < HammerCLIForeman::UpdateCommand
      option "--file", "LAYOUT", _("Path to a file that contains the partition layout"), :attribute_name => :option_layout,
        :format => HammerCLI::Options::Normalizers::File.new

      success_message _("Partition table updated")
      failure_message _("Could not update the partition table")

      build_options :without => [:layout]
    end


    class DeleteCommand < HammerCLIForeman::DeleteCommand
      success_message _("Partition table deleted")
      failure_message _("Could not delete the partition table")

      build_options
    end


    HammerCLIForeman::AssociatingCommands::OperatingSystem.extend_command(self)


    autoload_subcommands
  end

end


Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
hammer_cli_foreman-0.6.2 lib/hammer_cli_foreman/partition_table.rb
hammer_cli_foreman-0.6.1 lib/hammer_cli_foreman/partition_table.rb
hammer_cli_foreman-0.6.0 lib/hammer_cli_foreman/partition_table.rb
hammer_cli_foreman-0.5.1 lib/hammer_cli_foreman/partition_table.rb
hammer_cli_foreman-0.5.0 lib/hammer_cli_foreman/partition_table.rb
hammer_cli_foreman-0.4.0 lib/hammer_cli_foreman/partition_table.rb
hammer_cli_foreman-0.3.0 lib/hammer_cli_foreman/partition_table.rb
hammer_cli_foreman-0.2.0 lib/hammer_cli_foreman/partition_table.rb
hammer_cli_foreman-0.1.4 lib/hammer_cli_foreman/partition_table.rb
hammer_cli_foreman-0.1.3 lib/hammer_cli_foreman/partition_table.rb
hammer_cli_foreman-0.1.2 lib/hammer_cli_foreman/partition_table.rb