blackstack-nodes 1.2.2 → 1.2.3

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 +12 -2
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f1914918caf0642271ec5c864e5ed1109b9a511eba89efe94afe9776106e62db
4
- data.tar.gz: f7b96f4473e864856471a73c805350bbf094284edb7b5223e9b3840ca2e0a13f
3
+ metadata.gz: 564b1ff0cb7e036e0e9b934ededf8898c1c2fcec954f510fd9b4081bac502a68
4
+ data.tar.gz: 72f9667c3dddd1fd6bee131c3f4420681a6328c4584fe1c3455aa36389e3b87f
5
5
  SHA512:
6
- metadata.gz: 78c0bac3e2e1533530de97b20c0b67c5ae6070422ce9c9d76b4627946b621caee71171a18670ea6ae13f7f0dd2f7a8099655faff366bec2fa4384848f21f2b65
7
- data.tar.gz: '0871c9d89ff96f86bb0fb0c0f8c9a2a3328c9d750b509ebde0541c823ab84792e82d2cbe851a601a8283d064c48a5395c3ddb5522101d2136245e13fbb050deb'
6
+ metadata.gz: 6d18846e64fbe0dca169445941d502d45f88d57c7046c0b90a437188a574ae1c619eb04d8ffc0a5ed130d1141112f696fe8a21a7894642b30c066693bc2dbefb
7
+ data.tar.gz: 993e4291693c2ed190e924b9186ca2f97c5fef142d70097c3f76741f6d9a85ff9aed77238fed71ffcb3f3483701a4f1e13b056fb1ca7018d240d71c1c617af28
@@ -6,6 +6,9 @@ module BlackStack
6
6
  module Infrastructure
7
7
  # this module has attributes an methods used by both classes Node and Node.
8
8
  module NodeModule
9
+ # :name is this is just a descriptive name for the node. It is not the host name, nor the domain, nor any ip.
10
+ attr_accessor :name, :net_remote_ip, :ssh_username, :ssh_password, :ssh_port, :ssh_private_key_file
11
+ # non-database attributes, used for ssh connection and logging
9
12
  attr_accessor :ssh, :logger
10
13
 
11
14
  def self.descriptor_errors(h)
@@ -14,6 +17,15 @@ module BlackStack
14
17
  # validate: the parameter h is a hash
15
18
  errors << "The parameter h is not a hash" unless h.is_a?(Hash)
16
19
 
20
+ # validate: the parameter h has a key :name
21
+ errors << "The parameter h does not have a key :name" unless h.has_key?(:name)
22
+
23
+ # validate: the parameter h[:name] is a string
24
+ errors << "The parameter h[:name] is not a string" unless h[:name].is_a?(String)
25
+
26
+ # validate: does not exist any other element in @@nodes with the same value for the parameter h[:name]
27
+ errors << "The parameter h[:name] is not unique" if @@nodes.select{|n| n[:name] == h[:name]}.length > 0
28
+
17
29
  # validate: the paramerer h has a key :net_remote_ip
18
30
  errors << "The parameter h does not have a key :net_remote_ip" unless h.has_key?(:net_remote_ip)
19
31
 
@@ -149,8 +161,6 @@ module BlackStack
149
161
  # This class represents a node, without using connection to the database.
150
162
  # Use this class at the client side.
151
163
  class Node
152
- # :name is this is just a descriptive name for the node. It is not the host name, nor the domain, nor any ip.
153
- attr_accessor :name, :net_remote_ip, :ssh_username, :ssh_password, :ssh_port, :ssh_private_key_file
154
164
  include NodeModule
155
165
  end # class Node
156
166
  =begin
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.2
4
+ version: 1.2.3
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-05-30 00:00:00.000000000 Z
11
+ date: 2022-05-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: net-ssh