nexposecli 0.3.5 → 0.3.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fd5e1bfe0352682c0d5891a49d1a0a29d86a24ad
4
- data.tar.gz: 6c6eeb7f50fd3cd2e3583f23395011267204fd9b
3
+ metadata.gz: 976593240066ff9ba83acd5b90348036d03daf2a
4
+ data.tar.gz: 1ed2fccb5f0c603bbee957f83a7735ea58a6af73
5
5
  SHA512:
6
- metadata.gz: d616d9e79dcdf205f219b895142aa1297ff764f6bf093021861b2e300e39acc5bd412289d02815af676c3545786817caa032040716a4a9d12b973741311807d1
7
- data.tar.gz: a54150ac8cc2f81861ff2f82d02283b8f24cd13e1f7eebbf7326a94ffa36ba1ed352e747e824842f5b659a583ee1117adedd8fd7973639a6c074cab7539f4471
6
+ metadata.gz: 573438283544458561bf1f44494ceb64da10df67c5f81f93d8a5ab161f530d67d4c1292c8b4a9ecb0e7c878bd857f78030b95b8be0498440f8850cb48fe4e465
7
+ data.tar.gz: c549af274cac86bc03bebb550dd541ce1e520b86896f0fc7ef86a1473e7a460ca7d9b76438018c444e4187e0a44fe6f98c392e2eb6fcfcf28b5a52db723a9475
data/bin/nexposecli CHANGED
@@ -109,16 +109,28 @@ end
109
109
  def read_config(conf)
110
110
  # add check for file existence and perms
111
111
  config = YAML.load_file(conf)
112
+ begin
113
+ if config["config"].key?("server")
114
+ @nsc_server = config["config"]["server"]
115
+ else
116
+ puts "The config yaml file does not contain a valid [server] parameter.\nPlease confirm the yaml file is well-formed and complete."
117
+ exit(-1)
118
+ end
119
+ rescue NoMethodError => e
120
+ puts "The config yaml file does not to be well-formed and complete.\nThe config: appears to be null.\nPlease edit the config file and try again."
121
+ STDERR.puts "ERROR [ " + e.to_s + " ]"
122
+ exit(-1)
123
+ end
112
124
 
113
- @nsc_server = config["config"]["server"]
114
125
  if config["config"].key?("port")
115
126
  @nsc_port = config["config"]["port"]
116
127
  else
117
128
  @nsc_port = $nxport
118
129
  end
119
130
  @nsc_user = config["config"]["user"]
120
- @nsc_passwd = config["config"]["password"]
121
- if @nsc_passwd.nil?
131
+ if config["config"].key?("password")
132
+ @nsc_passwd = config["config"]["password"]
133
+ else
122
134
  puts "A console password was not provided via config file.\nWhat password shall I use?"
123
135
  @nsc_passwd = STDIN.noecho(&:gets).chomp
124
136
  end
@@ -1,3 +1,3 @@
1
1
  module Nexposecli
2
- VERSION = "0.3.5"
2
+ VERSION = "0.3.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nexposecli
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.5
4
+ version: 0.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Erik Gomez
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-04-04 00:00:00.000000000 Z
12
+ date: 2017-04-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nexpose