vmc_knife 0.0.68 → 0.0.69

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 CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- OTY0OTJhY2EyYWQ2OTAxNGQ3YjJhZTM3MDA1Y2RlZWE3MzM4MzRkZQ==
5
- data.tar.gz: !binary |-
6
- OWYwMGE5MmJmMGNlN2Y1NTc3NzM4NDJmYTI2MzA3ODIzOTkwNDMxNQ==
2
+ SHA1:
3
+ metadata.gz: dd20eef97ec8f8e1c8f6ab6233173d2542444639
4
+ data.tar.gz: 4eabbc37feceaf7786c726f4b9595446a9e3af49
7
5
  SHA512:
8
- metadata.gz: !binary |-
9
- NzgwMGZhN2E1M2NlMmUwYjhlMjZmNzIyYjM3NjEzNTQ5ZDFjN2JjNTg4NmE3
10
- ZDVjNTY2MzgwM2ZmNWFjODBlZDZkODJlOGM3ZGQzYjIwOTVmYWQzOGE4OWI4
11
- ODliOGVlNmQ4MjA0OTM5ZTFhNzk3YmIzMDIxYTU1NWRiZmQ2YjU=
12
- data.tar.gz: !binary |-
13
- NGRkMTcyOTE0OTczZThjOTk2M2ZlZDU2M2M0N2NkMDkxNzM0Mzc2NmRhOWE2
14
- MTAxNzMxMmVkYzgwNzhiZDhiMjgxMzk2NDRjY2I3ZWQxMzIyODJlZWFhZjg3
15
- NjlkYjIzOTk1NTMyM2Q3ZThjOGJjNWMzMmFjNjVlNWUyMmFjNTg=
6
+ metadata.gz: b36c181301be5fb4a8c8784e9cf9b7b7db068e42706133936181db51a7c6e55823a248de916221d37f67a8d2f3ba46963787fa0d522143395d9c3baa953a9ba3
7
+ data.tar.gz: 75690deb70f18526f7d495ec784753cd3345bee4fd9448627cb8d390d5ef0586f672027d71d2ca34bc82be8b142d8cc35de3b26c06156a4cccf86409d6cbdc78
@@ -30,13 +30,13 @@ module VMC
30
30
 
31
31
  def self.get_app_id(app_name)
32
32
  db=get_ccdb_credentials()
33
- app_id = `psql --username #{db['username']} --dbname #{db['database']} -c \"select id from apps where name='#{app_name}'\" #{PSQL_RAW_RES_ARGS}`.strip
33
+ app_id = `export PGPASSWORD=#{db['password']}; psql --host #{db['host']} --port #{db['port']} --username #{db['username']} --dbname #{db['database']} -c \"select id from apps where name='#{app_name}'\" #{PSQL_RAW_RES_ARGS}`.strip
34
34
  app_id unless app_id.empty?
35
35
  end
36
36
  def self.get_service_config_id(service_name)
37
37
  db=get_ccdb_credentials()
38
38
  #todo add the user_id
39
- service_config_id = `psql --username #{db['username']} --dbname #{db['database']} -c \"select id from service_configs where alias='#{service_name}'\" #{PSQL_RAW_RES_ARGS}`.strip
39
+ service_config_id = `export PGPASSWORD=#{db['password']}; psql --host #{db['host']} --port #{db['port']} --username #{db['username']} --dbname #{db['database']} -c \"select id from service_configs where alias='#{service_name}'\" #{PSQL_RAW_RES_ARGS}`.strip
40
40
  service_config_id unless service_config_id.empty?
41
41
  end
42
42
 
@@ -65,7 +65,7 @@ module VMC
65
65
  def self.get_credentials(service_name, app_name=nil)
66
66
  db=get_ccdb_credentials()
67
67
  if app_name.nil?
68
- credentials_str = `psql --username #{db['username']} --dbname #{db['database']} -c \"select credentials from service_configs where alias='#{service_name}'\" #{PSQL_RAW_RES_ARGS}`.strip
68
+ credentials_str = `export PGPASSWORD=#{db['password']}; psql --host #{db['host']} --port #{db['port']} --username #{db['username']} --dbname #{db['database']} -c \"select credentials from service_configs where alias='#{service_name}'\" #{PSQL_RAW_RES_ARGS}`.strip
69
69
  else
70
70
  app_id = get_app_id(app_name)
71
71
  if app_id.nil?
@@ -73,7 +73,7 @@ module VMC
73
73
  return
74
74
  end
75
75
  service_config_id = get_service_config_id(service_name)
76
- credentials_str = `psql --username #{db['username']} --dbname #{db['database']} -c \"select credentials from service_bindings where app_id = '#{app_id}' and service_config_id='#{service_config_id}'\" #{PSQL_RAW_RES_ARGS}`.strip
76
+ credentials_str = `export PGPASSWORD=#{db['password']}; psql --host #{db['host']} --port #{db['port']} --username #{db['username']} --dbname #{db['database']} -c \"select credentials from service_bindings where app_id = '#{app_id}' and service_config_id='#{service_config_id}'\" #{PSQL_RAW_RES_ARGS}`.strip
77
77
  end
78
78
  res = Hash.new
79
79
  credentials_str.split("\n").each do | line |
@@ -408,8 +408,9 @@ module VMC
408
408
  instance_name=creds['name']
409
409
  dbpath=File.join(base_dir, instance_name, 'data')
410
410
  mongod_lock=File.join(dbpath,'mongod.lock')
411
- puts "looking at #{mongod_lock} exists? #{File.exists?(mongod_lock)} size #{File.size(mongod_lock)}"
412
- if File.exists?(mongod_lock) && File.size(mongod_lock)>0
411
+ hostname = creds['hostname']
412
+ puts "looking at #{mongod_lock} exists? #{File.exists?(mongod_lock)} size #{File.size(mongod_lock)}" if File.exists?(mongod_lock)
413
+ if (File.exists?(mongod_lock) && File.size(mongod_lock)>0) || (hostname != '127.0.0.1' && hostname != 'localhost')
413
414
  cmd = "#{mongodump_exec} -u #{creds['username']} -p #{creds['password']} --host #{creds['hostname']}:#{creds['port']} --db db"
414
415
  else
415
416
  cmd = "#{mongodump_exec} --dbpath #{dbpath}"
@@ -2,7 +2,7 @@ module VMC
2
2
  module KNIFE
3
3
  module Cli
4
4
  # This version number is used as the RubyGem release version.
5
- VERSION = '0.0.68'
5
+ VERSION = '0.0.69'
6
6
  end
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,61 +1,61 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vmc_knife
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.68
4
+ version: 0.0.69
5
5
  platform: ruby
6
6
  authors:
7
7
  - Intalio, Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-07-25 00:00:00.000000000 Z
11
+ date: 2015-05-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: vmc
15
15
  requirement: !ruby/object:Gem::Requirement
16
16
  requirements:
17
- - - ~>
17
+ - - "~>"
18
18
  - !ruby/object:Gem::Version
19
19
  version: 0.3.18
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
- - - ~>
24
+ - - "~>"
25
25
  - !ruby/object:Gem::Version
26
26
  version: 0.3.18
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: rest-client
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
- - - ! '>='
31
+ - - ">="
32
32
  - !ruby/object:Gem::Version
33
33
  version: 1.6.1
34
- - - <
34
+ - - "<"
35
35
  - !ruby/object:Gem::Version
36
36
  version: 1.7.0
37
37
  type: :runtime
38
38
  prerelease: false
39
39
  version_requirements: !ruby/object:Gem::Requirement
40
40
  requirements:
41
- - - ! '>='
41
+ - - ">="
42
42
  - !ruby/object:Gem::Version
43
43
  version: 1.6.1
44
- - - <
44
+ - - "<"
45
45
  - !ruby/object:Gem::Version
46
46
  version: 1.7.0
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: rspec
49
49
  requirement: !ruby/object:Gem::Requirement
50
50
  requirements:
51
- - - ~>
51
+ - - "~>"
52
52
  - !ruby/object:Gem::Version
53
53
  version: 2.4.0
54
54
  type: :development
55
55
  prerelease: false
56
56
  version_requirements: !ruby/object:Gem::Requirement
57
57
  requirements:
58
- - - ~>
58
+ - - "~>"
59
59
  - !ruby/object:Gem::Version
60
60
  version: 2.4.0
61
61
  - !ruby/object:Gem::Dependency
@@ -83,7 +83,9 @@ extra_rdoc_files:
83
83
  files:
84
84
  - LICENSE
85
85
  - README.md
86
+ - bin/vmc_knife
86
87
  - lib/restclient/restclient_add_timeout.rb
88
+ - lib/vmc_knife.rb
87
89
  - lib/vmc_knife/cli_extensions.rb
88
90
  - lib/vmc_knife/commands/knife_cmds.rb
89
91
  - lib/vmc_knife/data_services.rb
@@ -92,8 +94,6 @@ files:
92
94
  - lib/vmc_knife/version.rb
93
95
  - lib/vmc_knife/vmc_helper.rb
94
96
  - lib/vmc_knife/vmc_knife.rb
95
- - lib/vmc_knife.rb
96
- - bin/vmc_knife
97
97
  homepage: http://intalio.com
98
98
  licenses: []
99
99
  metadata: {}
@@ -103,17 +103,17 @@ require_paths:
103
103
  - lib
104
104
  required_ruby_version: !ruby/object:Gem::Requirement
105
105
  requirements:
106
- - - ! '>='
106
+ - - ">="
107
107
  - !ruby/object:Gem::Version
108
108
  version: '0'
109
109
  required_rubygems_version: !ruby/object:Gem::Requirement
110
110
  requirements:
111
- - - ! '>='
111
+ - - ">="
112
112
  - !ruby/object:Gem::Version
113
113
  version: '0'
114
114
  requirements: []
115
115
  rubyforge_project:
116
- rubygems_version: 2.1.9
116
+ rubygems_version: 2.4.6
117
117
  signing_key:
118
118
  specification_version: 4
119
119
  summary: Extensions for VMC the CLI of VMWare's Cloud Foundry