blackstack-nodes 1.2.2 → 1.2.3
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 +4 -4
- data/lib/blackstack-nodes.rb +12 -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: 564b1ff0cb7e036e0e9b934ededf8898c1c2fcec954f510fd9b4081bac502a68
|
4
|
+
data.tar.gz: 72f9667c3dddd1fd6bee131c3f4420681a6328c4584fe1c3455aa36389e3b87f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6d18846e64fbe0dca169445941d502d45f88d57c7046c0b90a437188a574ae1c619eb04d8ffc0a5ed130d1141112f696fe8a21a7894642b30c066693bc2dbefb
|
7
|
+
data.tar.gz: 993e4291693c2ed190e924b9186ca2f97c5fef142d70097c3f76741f6d9a85ff9aed77238fed71ffcb3f3483701a4f1e13b056fb1ca7018d240d71c1c617af28
|
data/lib/blackstack-nodes.rb
CHANGED
@@ -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.
|
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-
|
11
|
+
date: 2022-05-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: net-ssh
|