Sha256: 6705e45081dd057740765128c37f781ea0dac96dbc2078c08f4746e34708f3c9

Contents?: true

Size: 803 Bytes

Versions: 11

Compression:

Stored size: 803 Bytes

Contents

require 'vagrant-openstack-provider/command/openstack_command'

module VagrantPlugins
  module Openstack
    module Command
      class NetworkList < OpenstackCommand
        def self.synopsis
          I18n.t('vagrant_openstack.command.network_list_synopsis')
        end

        def cmd(name, argv, env)
          fail Errors::UnrecognizedArgForCommand, cmd: name, arg: argv[1] if argv.size > 1
          if argv.size == 0
            networks = env[:openstack_client].neutron.get_private_networks(env)
          elsif argv[0] == 'all'
            networks = env[:openstack_client].neutron.get_all_networks(env)
          else
            fail Errors::UnrecognizedArgForCommand, cmd: name, arg: argv[0]
          end
          display_item_list(env, networks)
        end
      end
    end
  end
end

Version data entries

11 entries across 11 versions & 2 rubygems

Version Path
vagrant-openstack-provider-0.13.0 lib/vagrant-openstack-provider/command/network_list.rb
vagrant-openstack-provider-0.12.0 lib/vagrant-openstack-provider/command/network_list.rb
vagrant-openstack-provider-illuin-0.11.1 lib/vagrant-openstack-provider/command/network_list.rb
vagrant-openstack-provider-0.11.0 lib/vagrant-openstack-provider/command/network_list.rb
vagrant-openstack-provider-0.10.0 lib/vagrant-openstack-provider/command/network_list.rb
vagrant-openstack-provider-0.9.0 lib/vagrant-openstack-provider/command/network_list.rb
vagrant-openstack-provider-0.8.0 lib/vagrant-openstack-provider/command/network_list.rb
vagrant-openstack-provider-0.7.2 lib/vagrant-openstack-provider/command/network_list.rb
vagrant-openstack-provider-0.7.1 lib/vagrant-openstack-provider/command/network_list.rb
vagrant-openstack-provider-0.7.0 lib/vagrant-openstack-provider/command/network_list.rb
vagrant-openstack-provider-0.6.1 lib/vagrant-openstack-provider/command/network_list.rb