cloner 0.5.0 → 0.5.1

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,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5f458cd38cf985729bae72765cff1a62b1e20b95
4
- data.tar.gz: 49f0ec43973df92b49f320485fa492149e12310b
3
+ metadata.gz: ff039ecf77aa04b16d10b76f3ec8ec8dc494085d
4
+ data.tar.gz: 03534218c250e015f8f4ecc8d8f33d4cc6a7b610
5
5
  SHA512:
6
- metadata.gz: 3d8adf2b9f7ad47e2b311ee6417f6b6d49eca5e2b5afbec134b4a856dc29fc22c62952a6d0b39ac4b98b76e8101ca23b2b882221ea5a73529b969da0afca4bb7
7
- data.tar.gz: 319bf7a34e025e9d5b651195e58b922d905cb4bcd4046549bd4869eeb4fc273ec928636721069dfbf7feb5bcfa00e14b01aec33fdf2236202224bab5d6491227
6
+ metadata.gz: b9b5605a4be19035cc327d101f8a35cb654d1bee6f859af0ece4eeacc694277b6bb761d4940e21c7f1af9630c453d4b26a7215bc82210b3bf7e2474e860f63c2
7
+ data.tar.gz: 76a975a0aa4083a9e78ee1a38aa8718f20979354bc9c99b4adb55e5eacee5a2e8e178f691eabaf2ddd975aaa77a78319289ebf967b7841780527b90c8f125b9a
@@ -32,10 +32,12 @@ module Cloner::MongoDB
32
32
  end
33
33
 
34
34
  def mongodb_local_auth
35
- if mongodb_conf['password'].nil?
36
- ""
37
- else
35
+ if mongodb_conf['options'].present? && mongodb_conf['password'].present?
36
+ "-u #{e mongodb_conf['options']['user']} -p #{e mongodb_conf['options']['password']}"
37
+ elsif mongodb_conf['password'].present?
38
38
  "-u #{e mongodb_conf['username']} -p #{e mongodb_conf['password']}"
39
+ else
40
+ ""
39
41
  end
40
42
  end
41
43
 
@@ -45,7 +47,12 @@ module Cloner::MongoDB
45
47
  ssh.exec!("rm -R #{remote_dump_path}")
46
48
  ret = ssh_exec!(ssh, "mkdir -p #{remote_dump_path}")
47
49
  check_ssh_err(ret)
48
- dump = "mongodump -u #{e mongodb_r_conf['username']} -p #{e mongodb_r_conf['password']} -d #{e mongodb_r_conf['database']} --authenticationDatabase #{e mongodb_r_conf['database']} -o #{e remote_dump_path}"
50
+ if mongodb_r_conf['options'].present? && mongodb_r_conf['options']['password'].present?
51
+ username, password = mongodb_r_conf['options']['user'], mongodb_r_conf['options']['password']
52
+ else
53
+ username, password = mongodb_r_conf['username'], mongodb_r_conf['password']
54
+ end
55
+ dump = "mongodump -u #{e username} -p #{e password} -d #{e mongodb_r_conf['database']} --authenticationDatabase #{e mongodb_r_conf['database']} -o #{e remote_dump_path}"
49
56
  puts dump if verbose?
50
57
  ret = ssh_exec!(ssh, dump)
51
58
  check_ssh_err(ret)
@@ -1,3 +1,3 @@
1
1
  module Cloner
2
- VERSION = "0.5.0"
2
+ VERSION = "0.5.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cloner
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.0
4
+ version: 0.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - glebtv
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-07 00:00:00.000000000 Z
11
+ date: 2015-08-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor