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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/blackstack-nodes.rb +14 -2
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2c25e530e8abe10c782d351933d6e7b1593aa03755d21ea4f4af55681d198798
4
- data.tar.gz: f99df9959b7dcb90032df4694936e973b66e71eb03433b083e3e6d91367a1946
3
+ metadata.gz: 42fc87809bc244ccd4a897239eb1780f42dfc97f66412b181040563e30f3d8e6
4
+ data.tar.gz: 91cd94858cca707b5575ff9e359150becc288efcf638a12a9c4c3fb6c1788155
5
5
  SHA512:
6
- metadata.gz: 3f21c495c153e25e0ac66680ea36859f0ade0473053445ee227f8146d6d26b6eed37980cb34ca256080a53222f8992c3b3a0dcc27864e4163cfacf228200cf4e
7
- data.tar.gz: 194f6586dd2dd30d5504d9559f7314082bf35eca2d62431e64d364753b1ea223cbc91246dcf7549a5ecb59fa8243952ac1354301a5efd419bc7e8c5ef3d78849
6
+ metadata.gz: dcb19e2ce0d045496c267779d21e18592d406cb2819bb7b3582747e317f991a64a42afaa9aa3503dbfdc0ded4106cf3c4f4d3819a0ee8b5d562cef5ba1a5896a
7
+ data.tar.gz: a65bd7d8ea07f7e1c6916e231ac33b8742c086fa7b3c5b9958a813d2c408d1a2e266cc6ce9f123a840bf9a39b68faabbb526136fb6edd230acdde2795934625d
@@ -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.10
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-07 00:00:00.000000000 Z
11
+ date: 2022-12-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: net-ssh