blackstack-nodes 1.2.10 → 1.2.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/blackstack-nodes.rb +14 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 42fc87809bc244ccd4a897239eb1780f42dfc97f66412b181040563e30f3d8e6
|
4
|
+
data.tar.gz: 91cd94858cca707b5575ff9e359150becc288efcf638a12a9c4c3fb6c1788155
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dcb19e2ce0d045496c267779d21e18592d406cb2819bb7b3582747e317f991a64a42afaa9aa3503dbfdc0ded4106cf3c4f4d3819a0ee8b5d562cef5ba1a5896a
|
7
|
+
data.tar.gz: a65bd7d8ea07f7e1c6916e231ac33b8742c086fa7b3c5b9958a813d2c408d1a2e266cc6ce9f123a840bf9a39b68faabbb526136fb6edd230acdde2795934625d
|
data/lib/blackstack-nodes.rb
CHANGED
@@ -8,7 +8,7 @@ module BlackStack
|
|
8
8
|
# this module has attributes an methods used by both classes Node and Node.
|
9
9
|
module NodeModule
|
10
10
|
# :name is this is just a descriptive name for the node. It is not the host name, nor the domain, nor any ip.
|
11
|
-
attr_accessor :name, :net_remote_ip, :ssh_username, :ssh_password, :ssh_port, :ssh_private_key_file
|
11
|
+
attr_accessor :name, :net_remote_ip, :ssh_username, :ssh_password, :ssh_port, :ssh_private_key_file, :tags
|
12
12
|
# non-database attributes, used for ssh connection and logging
|
13
13
|
attr_accessor :ssh, :logger
|
14
14
|
|
@@ -48,6 +48,12 @@ module BlackStack
|
|
48
48
|
errors << "The parameter h[:ssh_password] is not a string" unless h[:ssh_password].is_a?(String)
|
49
49
|
end
|
50
50
|
|
51
|
+
# if the parameter h has a key :tags
|
52
|
+
if h.has_key?(:tags) && !h[:tags].nil?
|
53
|
+
# validate: the parameter h[:tags] is an array or a string
|
54
|
+
errors << "The parameter h[:tags] is not an array or a string" unless h[:tags].is_a?(Array) || h[:tags].is_a?(String)
|
55
|
+
end
|
56
|
+
|
51
57
|
# return
|
52
58
|
errors
|
53
59
|
end # def self.descriptor_errors(h)
|
@@ -63,7 +69,12 @@ module BlackStack
|
|
63
69
|
self.ssh_password = h[:ssh_password]
|
64
70
|
self.ssh_port = h[:ssh_port]
|
65
71
|
self.ssh_private_key_file = h[:ssh_private_key_file]
|
66
|
-
|
72
|
+
# parse the tags
|
73
|
+
if h.has_key?(:tags) && !h[:tags].nil?
|
74
|
+
self.tags = h[:tags].is_a?(Array) ? h[:tags] : [h[:tags]]
|
75
|
+
else
|
76
|
+
self.tags = []
|
77
|
+
end
|
67
78
|
# create a logger
|
68
79
|
self.logger = !i_logger.nil? ? i_logger : BlackStack::BaseLogger.new(nil)
|
69
80
|
end # def self.create(h)
|
@@ -76,6 +87,7 @@ module BlackStack
|
|
76
87
|
:ssh_password => self.ssh_password,
|
77
88
|
:ssh_port => self.ssh_port,
|
78
89
|
:ssh_private_key_file => self.ssh_private_key_file,
|
90
|
+
:tags => self.tags
|
79
91
|
}
|
80
92
|
end # def to_hash
|
81
93
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: blackstack-nodes
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Leandro Daniel Sardi
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-09
|
11
|
+
date: 2022-12-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: net-ssh
|