fog-openstack 0.1.14 → 0.1.15
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 85c015f66fafdd1aeb99e59443520114635930dc
|
4
|
+
data.tar.gz: d0915c5216fd3e3bfd6c47f010a5e7dccabb0aee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 56f592d5413f1f712421cc7fa16f973b8b2445f89f0b4e719e3431350061795bc5bfa56e320a83e8173870409d1af3d4df08fdbedfd33e3d7b21edf2d5ec32f5
|
7
|
+
data.tar.gz: 360408ce8e42a4b21ea35f01d85bc76348ad18d99b7609d4e57f1b5284e2c3763432d2648203b34bbe529bd2994b5d078ad52c1562d18473676b5d1360ce4f2d
|
@@ -22,9 +22,14 @@ module Fog
|
|
22
22
|
end
|
23
23
|
|
24
24
|
def save
|
25
|
-
raise Fog::Errors::Error, 'Resaving an existing object may create a duplicate' if persisted?
|
26
25
|
merge_attributes(service.create_security_group(attributes).body['security_group'])
|
27
|
-
|
26
|
+
self
|
27
|
+
end
|
28
|
+
|
29
|
+
def update
|
30
|
+
requires :id
|
31
|
+
merge_attributes(service.update_security_group(id, attributes).body['security_group'])
|
32
|
+
self
|
28
33
|
end
|
29
34
|
end
|
30
35
|
end
|
@@ -0,0 +1,41 @@
|
|
1
|
+
module Fog
|
2
|
+
module Network
|
3
|
+
class OpenStack
|
4
|
+
class Real
|
5
|
+
def update_security_group(security_group_id, options = {})
|
6
|
+
data = {'security_group' => {}}
|
7
|
+
|
8
|
+
[:name, :description].each do |key|
|
9
|
+
data['security_group'][key] = options[key] if options[key]
|
10
|
+
end
|
11
|
+
|
12
|
+
request(
|
13
|
+
:body => Fog::JSON.encode(data),
|
14
|
+
:expects => 200,
|
15
|
+
:method => 'PUT',
|
16
|
+
:path => "security-groups/#{security_group_id}"
|
17
|
+
)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
class Mock
|
22
|
+
def update_security_group(security_group_id, options = {})
|
23
|
+
response = Excon::Response.new
|
24
|
+
security_group = list_security_groups.body['security_groups'].find do |sg|
|
25
|
+
sg['id'] == security_group_id
|
26
|
+
end
|
27
|
+
|
28
|
+
if security_group
|
29
|
+
security_group['name'] = options[:name]
|
30
|
+
security_group['description'] = options[:description]
|
31
|
+
response.body = {'security_group' => security_group}
|
32
|
+
response.status = 200
|
33
|
+
response
|
34
|
+
else
|
35
|
+
raise Fog::Network::OpenStack::NotFound
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
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.
|
4
|
+
version: 0.1.15
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matt Darby
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-10-
|
11
|
+
date: 2016-10-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: fog-core
|
@@ -833,6 +833,7 @@ files:
|
|
833
833
|
- lib/fog/network/openstack/requests/update_quota.rb
|
834
834
|
- lib/fog/network/openstack/requests/update_rbac_policy.rb
|
835
835
|
- lib/fog/network/openstack/requests/update_router.rb
|
836
|
+
- lib/fog/network/openstack/requests/update_security_group.rb
|
836
837
|
- lib/fog/network/openstack/requests/update_subnet.rb
|
837
838
|
- lib/fog/network/openstack/requests/update_vpn_service.rb
|
838
839
|
- lib/fog/nfv/openstack.rb
|