fog-openstack 0.1.23 → 0.1.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 57deefcd73bd729138eb23ed6b27a7d5edebd986
4
- data.tar.gz: 3f0e6066357fcac8d96ef1acace0ecc03336de19
3
+ metadata.gz: 77699371cb9d1cea2f5ced1bc246594c70b412da
4
+ data.tar.gz: 875158fd7550f7714b0f4082ec8e7a9a0b4684ef
5
5
  SHA512:
6
- metadata.gz: be0002aaf6e52c2578b3ec290e5cbe1dd7ef3fb30e1c5d58827e0de2c8fef58a99b812cf6e64c131f36a09c7b3d025d00731a277da19fa96f0e1f7080c67f8a5
7
- data.tar.gz: 76d3fffed28f2442446a69c41a71eeba4eb1684183417fb605ee16a524425cc7a93dc4fc8c57d9da76901107b97514eaf9d1cba2eec2c80228fc948780a3c6a3
6
+ metadata.gz: 46745f15db6c180aa55ead7a7ae8246b73bfcd489c54feb8f929b5678b9dfb9b74a0a9ecbec18697c9e70d72fce98519e8df4a017cd7638f132e0a74dda3cfba
7
+ data.tar.gz: 2a683b1003fbfd0dc25f22e59be0c7c02acdc615bb1fbffc8cccf66991162d6ff849d776aa75d6955d6ed823ecc72869212fd33dffe2637096012f11bdd570a3
data/.rubocop.yml CHANGED
@@ -9,6 +9,7 @@ AlignHash:
9
9
  BlockNesting:
10
10
  Severity: refactor
11
11
  ClassLength:
12
+ Max: 150
12
13
  Severity: refactor
13
14
  ClassCheck:
14
15
  EnforcedStyle: kind_of?
@@ -30,6 +31,17 @@ LineLength:
30
31
  MethodLength:
31
32
  Max: 25
32
33
  Severity: refactor
34
+ # Exclude test methods from BlockLength.
35
+ Metrics/BlockLength:
36
+ ExcludedMethods:
37
+ - after
38
+ - before
39
+ - context
40
+ - describe
41
+ - it
42
+ - model_tests
43
+ - namespace
44
+ - draw
33
45
  ParameterLists:
34
46
  Severity: refactor
35
47
  PerceivedComplexity:
data/.travis.yml CHANGED
@@ -3,7 +3,7 @@ sudo: false
3
3
  before_install:
4
4
  - gem update bundler
5
5
  script:
6
- - bundle exec rake test
6
+ - bundle exec rake test TESTOPTS="--verbose"
7
7
  - bundle exec rake spec
8
8
  env:
9
9
  - JRUBY_OPTS=--debug
data/README.md CHANGED
@@ -113,7 +113,7 @@ p compute.flavors
113
113
  # disk=1,
114
114
  # vcpus=1,
115
115
  # ...
116
- # >,
116
+ # >,
117
117
  # <Fog::Compute::OpenStack::Flavor
118
118
  # id="2",
119
119
  # name="m1.small",
@@ -182,7 +182,7 @@ security_group = compute.security_groups.create name: "Test SSH",
182
182
  # description="Allow access to port 22",
183
183
  # security_group_rules= <Fog::Compute::OpenStack::SecurityGroupRules
184
184
  # [
185
-
185
+
186
186
  # ]
187
187
  # >,
188
188
  # tenant_id="06a9a90c60074cdeae5f7fdd0048d9ac"
@@ -418,7 +418,7 @@ identity.projects
418
418
  # description="Project 1",
419
419
  # enabled=true,
420
420
  # name="project_1",
421
- # >,
421
+ # >,
422
422
  # ...
423
423
  # ]
424
424
 
@@ -539,9 +539,28 @@ neutron.add_router_interface router.id, subnet.id
539
539
 
540
540
  ## Development
541
541
 
542
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
542
+ ```
543
+ $ git clone https://github.com/fog/fog-openstack.git # Clone repository
544
+ $ cd fog-openstack; bin/setup # Install dependencies from project directory
545
+ $ bundle exec rake test # Run tests
546
+ $ bundle exec rake spec # Run tests
547
+ $ bin/console # Run interactive prompt that allows you to experiment (optional)
548
+ $ bundle exec rake install # Install gem to your local machine (optional)
549
+ ```
550
+
551
+ You can also use a docker image for development and running tests. Once you have
552
+ cloned the repository, it can be run with:
553
+ ```
554
+ $ docker-compose up test
555
+ $ docker-compose up ruby # Start a container with the ruby environment
556
+ ```
543
557
 
544
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
558
+ In order to release a new version, perform the following steps:
559
+
560
+ 1. Update version number in `version.rb`.
561
+ 2. Run `bundle exec rake release`, which will create a git tag for the version.
562
+ 3. Push git commits and tags.
563
+ 4. Push the `.gem` file to [rubygems.org](https://rubygems.org).
545
564
 
546
565
  ## Contributing
547
566
 
@@ -551,4 +570,3 @@ Bug reports and pull requests are welcome on GitHub at https://github.com/fog/fo
551
570
  ## License
552
571
 
553
572
  The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).
554
-
@@ -0,0 +1,44 @@
1
+ #
2
+ # This file allows to:
3
+ # - create a ruby docker environment for development
4
+ # - run a testsuite from scratch like .travis.yml
5
+ #
6
+ # Run all tests with
7
+ #
8
+ # $ docker-compose up test
9
+ #
10
+ # Create the develompent environment with
11
+ #
12
+ # $ docker-compose up -d ruby
13
+ # $ docker exec -ti fogopenstack_ruby_1 /bin/bash
14
+ #
15
+ version: '2'
16
+
17
+ services:
18
+
19
+ ruby:
20
+ image: ruby:2.4-stretch
21
+ cap_add:
22
+ - SYS_PTRACE
23
+ volumes:
24
+ - .:/code:z
25
+ - .:/home/travis/build/fog/fog-openstack:z
26
+ entrypoint: tail -f /etc/hosts
27
+
28
+ test:
29
+ image: ruby:2.4-stretch
30
+ cap_add:
31
+ - SYS_PTRACE
32
+ volumes:
33
+ - .:/code:z
34
+ - .:/home/travis/build/fog/fog-openstack:z
35
+ environment:
36
+ - JRUBY_OPTS=--debug
37
+ working_dir: /home/travis/build/fog/fog-openstack
38
+ entrypoint: |
39
+ bash -c '
40
+ gem update bundler --verbose
41
+ bundle install --verbose
42
+ bundle exec rake test
43
+ bundle exec rake spec
44
+ '
@@ -396,7 +396,7 @@ module Fog
396
396
 
397
397
  authenticate
398
398
 
399
- unless @path =~ %r{/(v2|v2\.0|v2\.1)/}
399
+ unless @path =~ %r{/(v2|v2\.0|v2\.1)}
400
400
  raise Fog::OpenStack::Errors::ServiceUnavailable,
401
401
  "OpenStack compute binding only supports version v2 and v2.1"
402
402
  end
@@ -145,7 +145,7 @@ module Fog
145
145
 
146
146
  def headers(additional_headers)
147
147
  additional_headers ||= {}
148
- if @microversion
148
+ unless @microversion.nil? || @microversion.empty?
149
149
  microversion_value = if @microversion_key == 'Openstack-API-Version'
150
150
  "#{@microversion_service_type} #{@microversion}"
151
151
  else
@@ -1,5 +1,5 @@
1
1
  module Fog
2
2
  module Openstack
3
- VERSION = "0.1.23"
3
+ VERSION = "0.1.24"
4
4
  end
5
5
  end
@@ -44,7 +44,22 @@ module Fog
44
44
  request :post_set_meta_temp_url_key
45
45
  request :public_url
46
46
 
47
+ module Utils
48
+ def require_mime_types
49
+ # Use mime/types/columnar if available, for reduced memory usage
50
+ require 'mime/types/columnar'
51
+ rescue LoadError
52
+ begin
53
+ require 'mime/types'
54
+ rescue LoadError
55
+ Fog::Logger.warning("'mime-types' missing, please install and try again.")
56
+ exit(1)
57
+ end
58
+ end
59
+ end
60
+
47
61
  class Mock
62
+ include Utils
48
63
  def self.data
49
64
  @data ||= Hash.new do |hash, key|
50
65
  hash[key] = {}
@@ -56,6 +71,7 @@ module Fog
56
71
  end
57
72
 
58
73
  def initialize(options = {})
74
+ require_mime_types
59
75
  @openstack_api_key = options[:openstack_api_key]
60
76
  @openstack_username = options[:openstack_username]
61
77
  @path = '/v1/AUTH_1234'
@@ -81,6 +97,7 @@ module Fog
81
97
  end
82
98
 
83
99
  class Real
100
+ include Utils
84
101
  include Fog::OpenStack::Core
85
102
 
86
103
  def self.not_found_class
@@ -88,6 +105,7 @@ module Fog
88
105
  end
89
106
 
90
107
  def initialize(options = {})
108
+ require_mime_types
91
109
  initialize_identity options
92
110
 
93
111
  @openstack_service_type = options[:openstack_service_type] || ['object-store']
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fog-openstack
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.23
4
+ version: 0.1.24
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matt Darby
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-01-15 00:00:00.000000000 Z
11
+ date: 2018-02-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fog-core
@@ -214,6 +214,7 @@ files:
214
214
  - Rakefile
215
215
  - bin/console
216
216
  - bin/setup
217
+ - docker-compose.yml
217
218
  - docs/common/connection_params.md
218
219
  - docs/common/resources.md
219
220
  - docs/compute.md