Module: VagrantPlugins::Openstack
- Defined in:
- lib/vagrant-openstack-provider.rb,
lib/vagrant-openstack-provider/action.rb,
lib/vagrant-openstack-provider/config.rb,
lib/vagrant-openstack-provider/errors.rb,
lib/vagrant-openstack-provider/plugin.rb,
lib/vagrant-openstack-provider/version.rb,
lib/vagrant-openstack-provider/provider.rb,
lib/vagrant-openstack-provider/client/nova.rb,
lib/vagrant-openstack-provider/client/utils.rb,
lib/vagrant-openstack-provider/action/resume.rb,
lib/vagrant-openstack-provider/action/message.rb,
lib/vagrant-openstack-provider/action/suspend.rb,
lib/vagrant-openstack-provider/client/neutron.rb,
lib/vagrant-openstack-provider/client/keystone.rb,
lib/vagrant-openstack-provider/action/wait_stop.rb,
lib/vagrant-openstack-provider/client/openstack.rb,
lib/vagrant-openstack-provider/action/read_state.rb,
lib/vagrant-openstack-provider/action/stop_server.rb,
lib/vagrant-openstack-provider/action/start_server.rb,
lib/vagrant-openstack-provider/action/sync_folders.rb,
lib/vagrant-openstack-provider/action/create_server.rb,
lib/vagrant-openstack-provider/action/delete_server.rb,
lib/vagrant-openstack-provider/action/read_ssh_info.rb,
lib/vagrant-openstack-provider/action/connect_openstack.rb
Defined Under Namespace
Modules: Action, Errors, Utils Classes: Config, Item, KeystoneClient, NeutronClient, NovaClient, Plugin, Provider, Session
Constant Summary collapse
- VERSION =
'0.2.0'
Class Method Summary collapse
-
.init_i18n ⇒ Object
This initializes the i18n load path so that the plugin-specific translations work.
-
.init_logging ⇒ Object
This initializes the logging so that our logs are outputted at the same level as Vagrant core logs.
- .keystone ⇒ Object
- .neutron ⇒ Object
- .nova ⇒ Object
- .session ⇒ Object
-
.source_root ⇒ Pathname
This returns the path to the source of this plugin.
Class Method Details
.init_i18n ⇒ Object
This initializes the i18n load path so that the plugin-specific translations work.
12 13 14 15 |
# File 'lib/vagrant-openstack-provider.rb', line 12 def self.init_i18n I18n.load_path << File.('locales/en.yml', source_root) I18n.reload! end |
.init_logging ⇒ Object
This initializes the logging so that our logs are outputted at the same level as Vagrant core logs.
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/vagrant-openstack-provider.rb', line 19 def self.init_logging # Initialize logging level = nil begin level = Log4r.const_get(ENV['VAGRANT_LOG'].upcase) rescue NameError # This means that the logging constant wasn't found, # which is fine. We just keep `level` as `nil`. But # we tell the user. begin level = Log4r.const_get(ENV['VAGRANT_OPENSTACK_LOG'].upcase) rescue NameError level = nil end end # Some constants, such as "true" resolve to booleans, so the # above error checking doesn't catch it. This will check to make # sure that the log level is an integer, as Log4r requires. level = nil unless level.is_a?(Integer) # Set the logging level # logs as long as we have a valid level. if level logger = Log4r::Logger.new('vagrant_openstack') out = Log4r::Outputter.stdout out.formatter = Log4r::PatternFormatter.new(pattern: '%d | %5l | %m', date_pattern: '%Y-%m-%d %H:%M') logger.outputters = out logger.level = level end end |
.keystone ⇒ Object
29 30 31 |
# File 'lib/vagrant-openstack-provider/client/openstack.rb', line 29 def self.keystone Openstack::KeystoneClient.instance end |
.neutron ⇒ Object
37 38 39 |
# File 'lib/vagrant-openstack-provider/client/openstack.rb', line 37 def self.neutron Openstack::NeutronClient.instance end |
.nova ⇒ Object
33 34 35 |
# File 'lib/vagrant-openstack-provider/client/openstack.rb', line 33 def self.nova Openstack::NovaClient.instance end |
.session ⇒ Object
25 26 27 |
# File 'lib/vagrant-openstack-provider/client/openstack.rb', line 25 def self.session Session.instance end |
.source_root ⇒ Pathname
This returns the path to the source of this plugin.
54 55 56 |
# File 'lib/vagrant-openstack-provider.rb', line 54 def self.source_root @source_root ||= Pathname.new(File.('../../', __FILE__)) end |