ocean_kit 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/ocean_kit/firewalls.rb +4 -4
- data/lib/ocean_kit/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 62d343d2e641d29b1d725b8fa28cc31ae1f315c6066301d259690044e5bdec0c
|
4
|
+
data.tar.gz: fe8ea0a906be855815be19084fdba93c37cdb39ddafc70fb3d963e56b1294541
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 18da4133b0419fec8d780d1eeaa5fa7a97e271cc4a99daeb8329d2ca0045757bfd34b9fea68cf346fcac4feca10ab66edbcd264404245bbfa7aa9809d9f73197
|
7
|
+
data.tar.gz: 71c1d8033773066e2ae9d6418bcfb2e4ceb274483131cddbe6677b3c9093250276dacba52a12bfb0fdb94e8d65f74d0bac6942938cfa7bed8eb7cbacc72d686a
|
data/Gemfile.lock
CHANGED
data/lib/ocean_kit/firewalls.rb
CHANGED
@@ -45,7 +45,7 @@ module OceanKit
|
|
45
45
|
|
46
46
|
desc "enable_ssh [firewall_number]", "Enable SSH on given firewall"
|
47
47
|
def enable_ssh(number)
|
48
|
-
firewall =
|
48
|
+
firewall = fetch_firewall(number)
|
49
49
|
inbound_rules = firewall_inbound_rules(firewall)
|
50
50
|
firewall.inbound_rules = add_ssh_rule(inbound_rules)
|
51
51
|
begin
|
@@ -58,7 +58,7 @@ module OceanKit
|
|
58
58
|
|
59
59
|
desc "disable_ssh [firewall_number]", "Disable SSH on given firewall"
|
60
60
|
def disable_ssh(number)
|
61
|
-
firewall =
|
61
|
+
firewall = fetch_firewall(number)
|
62
62
|
inbound_rules = firewall_inbound_rules(firewall)
|
63
63
|
firewall.inbound_rules = remove_ssh_rule(inbound_rules)
|
64
64
|
begin
|
@@ -71,8 +71,8 @@ module OceanKit
|
|
71
71
|
|
72
72
|
private
|
73
73
|
|
74
|
-
def
|
75
|
-
do_client.firewalls.all.each_with_index.filter { |firewall, index| index == number.to_i }.flatten.first
|
74
|
+
def fetch_firewall(number)
|
75
|
+
do_client.firewalls.all.each_with_index.filter { |firewall, index| index == number.to_i }.flatten.first
|
76
76
|
end
|
77
77
|
|
78
78
|
def update_firewall(firewall)
|
data/lib/ocean_kit/version.rb
CHANGED