knife-ec-backup 2.4.7 → 2.4.12

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
  SHA256:
3
- metadata.gz: 4801984205d4df0174d61e67d8b4ebe4a6199778a5bc3b4048fb1f4f25d0c027
4
- data.tar.gz: ed391c6e19f1f091aa0993d887d6ece7f76c04475f26ac7499a360e91d032a0e
3
+ metadata.gz: 312e0c84f3b2b40b6a2824917e31da481007f65f1b82282a18ec441e398220bd
4
+ data.tar.gz: e2f1962db8526925402afcf73c145f04ffda47263fa8bade5064c2d50f494c3e
5
5
  SHA512:
6
- metadata.gz: f80e17213b08ffec758bdca995b78acd55d439d9ea777d33ccbc75bd185ca604a5749a44a241c098f9da52033fb5d746b994cf5388c82b953036486e6df7c5fd
7
- data.tar.gz: 75cedd7e96b53bdb7be8eb95195940fd955edbb3c7b59c20af41b6af858aa737ace3f66f2ad65ff7fb5f9da93f9aede80fc8d1395e2400b43b2a66f30422f008
6
+ metadata.gz: 16f96728387157fad3ef2fe38c18c9597c8c2fc2b6cb295262a7c161fc52d2fddaa40b38e38ad3e4c39af22fbec8dbf4c3bce74b8b0c97da7b22994e3cc2e7c9
7
+ data.tar.gz: e8bb31bc8fde89b682b2ab3dd8c89c7bc9b885af3f9e21d30e1e3e3875f8beea9ccb228fb3e6c8909300cf79c6bfe24e799b83af85b83b3d0ec348f59959466b
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # Knife EC Backup
2
- [![Build Status Master](https://travis-ci.org/chef/knife-ec-backup.svg?branch=master)](https://travis-ci.org/chef/knife-ec-backup)
2
+ [![Build status](https://badge.buildkite.com/4bc85427aab66accafbd7abb2932b9dd7f9208162c5be33488.svg?branch=master)](https://buildkite.com/chef-oss/chef-knife-ec-backup-master-verify)
3
3
  [![Gem Version](https://badge.fury.io/rb/knife-ec-backup.svg)](https://badge.fury.io/rb/knife-ec-backup)
4
4
 
5
5
  **Umbrella Project**: [Knife](https://github.com/chef/chef-oss-practices/blob/master/projects/knife.md)
@@ -10,7 +10,7 @@
10
10
 
11
11
  **Pull Request [Response Time Maximum](https://github.com/chef/chef-oss-practices/blob/master/repo-management/repo-states.md)**: 14 days
12
12
 
13
- # Description
13
+ ## Description
14
14
 
15
15
  knife-ec-backup can backup and restore the data in an Enterprise Chef
16
16
  Server installation, preserving the data in an intermediate, editable
@@ -21,26 +21,21 @@ Server API deficiencies. The long-run goal is to improve `knife
21
21
  download`, `knife upload` and the Chef Server API and deprecate this
22
22
  tool.
23
23
 
24
- # Requirements
24
+ ## Requirements
25
25
 
26
26
  This knife plugin requires Chef Client 11.8+.
27
27
 
28
- ## Chef 10
28
+ ### Server Support
29
29
 
30
- Users who are still using Chef 10 can use the most recent 1.x version
31
- of this gem. Version 1.x additionally depends on knife-essentials.
32
-
33
- ## Server Support
34
-
35
- This plugin currently supports Enterprise Chef 11 and Chef Server 12.
30
+ This plugin currently supports Enterprise Chef 11 and Chef Server 12+.
36
31
  Support for the beta key rotation features is provided via the
37
32
  `--with-keys-sql` flag, but users of this feature should note that
38
33
  this may change once the Chef Server supports an API-based export of
39
34
  the key data.
40
35
 
41
- # Installation
36
+ ## Installation
42
37
 
43
- ## Chef Server Install (Recommended)
38
+ ### Chef Server Install (Recommended)
44
39
 
45
40
  This gem is installed with chef-server-core 12.0.0 and newer.
46
41
 
@@ -53,7 +48,7 @@ downloading the .zip file. Once unpacked, run:
53
48
  /opt/opscode/embedded/bin/gem install knife-ec-backup*gem --no-ri --no-rdoc -V
54
49
  ```
55
50
 
56
- ### Note on installing with existing development tools:
51
+ #### Note on installing with existing development tools:
57
52
 
58
53
  The latest versions of knife-ec-backup require gems with native
59
54
  extensions, thus you must install a standard build toolchain. To
@@ -84,17 +79,17 @@ Clone the git repository and run the following from inside:
84
79
  gem build knife-ec-backup.gemspec
85
80
  gem install knife-ec-backup*gem
86
81
 
87
- # Configuration
82
+ ## Configuration
88
83
 
89
- ## Permissions
84
+ ### Permissions
90
85
 
91
86
  Note that most users in an EC installation lack the permissions to pull all of the data from all organizations and other users.
92
87
  This plugin **REQUIRES THE PIVOTAL KEY AND WEBUI KEY** from the Chef Server.
93
88
  It is recommended that you run this from a frontend Enterprise Chef Server, you can use --user and --key to pass the pivotal information along.
94
89
 
95
- # Subcommands
90
+ ## Subcommands
96
91
 
97
- ## Common Options
92
+ ### Common Options
98
93
 
99
94
  The following options are supported across all subcommands:
100
95
 
@@ -122,7 +117,7 @@ The following options are supported across all subcommands:
122
117
  * `--dry-run`:
123
118
  Report what actions would be taken without performing any. (default: false)
124
119
 
125
- ## knife ec backup DEST_DIR (options)
120
+ ### knife ec backup DEST_DIR (options)
126
121
 
127
122
  *Path*: If you have chef-client installed as well, you may need to invoke this as `/opt/opscode/embedded/bin/knife ec backup backup`
128
123
 
@@ -214,7 +209,7 @@ This compares very closely with the "knife download /" from an OSC server:
214
209
  users
215
210
  <name>.json>
216
211
 
217
- ## knife ec restore DEST_DIR (options)
212
+ ### knife ec restore DEST_DIR (options)
218
213
 
219
214
  Restores all data from the specified DEST_DIR to an Enterprise Chef /
220
215
  Private Chef server. DEST_DIR should be a backup directory created by
@@ -243,7 +238,7 @@ Private Chef server. DEST_DIR should be a backup directory created by
243
238
  also skip any auto-configured options (default: false)
244
239
 
245
240
  * `--[no-]skip-user-ids`:
246
- Reuses user ids from the restore destination when updating existing
241
+ Reuses user ids from the restore destination when updating existing
247
242
  users to avoid database conflicts (default: true)
248
243
 
249
244
  * `--with-user-sql`:
@@ -268,10 +263,10 @@ Private Chef server. DEST_DIR should be a backup directory created by
268
263
  Chef objects.
269
264
 
270
265
  * `--only-org ORG`:
271
- Only donwload/restore objects in the named organization. Global
266
+ Only download/restore objects in the named organization. Global
272
267
  objects such as users will still be downloaded/restored.
273
268
 
274
- ## knife ec key export [FILENAME]
269
+ ### knife ec key export [FILENAME]
275
270
 
276
271
  Create a json representation of the users table from the Chef Server
277
272
  database. If no argument is given, the name of the backup is
@@ -280,7 +275,7 @@ database. If no argument is given, the name of the backup is
280
275
  Please note, most users should use `knife ec backup` with the
281
276
  `--with-user-sql` option rather than this command.
282
277
 
283
- ## knife ec key import [FILENAME]
278
+ ### knife ec key import [FILENAME]
284
279
 
285
280
  Import a json representation of the users table from FILENAME to the
286
281
  the Chef Server database. If no argument is given, the filename is
@@ -289,7 +284,7 @@ assumed to be `key_dump.json`.
289
284
  Please note, most user should use `knife ec restore` with the
290
285
  `--with-user-sql` option rather than this command.
291
286
 
292
- # Known Bugs
287
+ ## Known Bugs
293
288
 
294
289
  - knife-ec-backup cannot be installed in the embedded gemset of Chef
295
290
  Server 12. This will be resolved in a future Chef Server release.
data/Rakefile CHANGED
@@ -1,5 +1,5 @@
1
1
  require 'bundler'
2
- require 'rubygems'
2
+ require 'rubygems' unless defined?(Gem)
3
3
  require 'rubygems/package_task'
4
4
  require 'rdoc/task'
5
5
  require 'rspec/core/rake_task'
@@ -15,7 +15,7 @@ class Chef
15
15
  require 'chef/chef_fs/file_pattern'
16
16
  require 'chef/chef_fs/parallelizer'
17
17
  require_relative '../server'
18
- require 'fileutils'
18
+ require 'fileutils' unless defined?(FileUtils)
19
19
  end
20
20
 
21
21
  def run
@@ -96,10 +96,10 @@ class Chef
96
96
  knife_ec_error_handler.add(ex)
97
97
  next
98
98
  end
99
- # Enterprise Chef 11 and below uses a pool of precreated
99
+ # Enterprise Chef 11 and below uses a pool of pre-created
100
100
  # organizations to account for slow organization creation
101
101
  # using CouchDB. Thus, on server versions < 12 we want to
102
- # skip any of these precreated organizations by checking if
102
+ # skip any of these pre-created organizations by checking if
103
103
  # they have been assigned or not. The Chef 12 API does not
104
104
  # return an assigned_at field.
105
105
  if org['assigned_at'] || server.version >= Gem::Version.new("12")
@@ -20,7 +20,7 @@ require 'chef/knife'
20
20
  require 'chef/server_api'
21
21
  require 'veil'
22
22
  require_relative 'ec_error_handler'
23
- require 'ffi_yajl'
23
+ require 'ffi_yajl' unless defined?(FFI_Yajl)
24
24
 
25
25
  class Chef
26
26
  class Knife
@@ -27,7 +27,7 @@ class Chef
27
27
 
28
28
  deps do
29
29
  require 'sequel'
30
- require 'json'
30
+ require 'json' unless defined?(JSON)
31
31
  end
32
32
 
33
33
  option :sql_host,
@@ -184,7 +184,7 @@ class Chef
184
184
  d.delete('id') if config[:skip_ids]
185
185
  # If the hash_type in the export,
186
186
  # we are dealing with a record where the password is still in the
187
- # serialized_obejct. Explictly setting these to nil ensures that the
187
+ # serialized_object. Explicitly setting these to nil ensures that the
188
188
  # password set in the restore is wiped out.
189
189
  unless d.has_key?('hash_type')
190
190
  d['hash_type'] = nil
@@ -33,7 +33,7 @@ class Chef
33
33
  # Work around bug in chef_fs
34
34
  require 'chef/chef_fs/command_line'
35
35
  require 'chef/chef_fs/data_handler/acl_data_handler'
36
- require 'securerandom'
36
+ require 'securerandom' unless defined?(SecureRandom)
37
37
  require 'chef/chef_fs/parallelizer'
38
38
  require_relative '../tsorter'
39
39
  require_relative '../server'
@@ -229,7 +229,7 @@ class Chef
229
229
  ui.msg "Restoring org admin data"
230
230
  chef_fs_config = Chef::ChefFS::Config.new
231
231
 
232
- # Handle Admins, Billing Admins and Public Key Read Access seperately
232
+ # Handle Admins, Billing Admins and Public Key Read Access separately
233
233
  #
234
234
  # admins: We need to upload admins first so that we
235
235
  # can upload all of the other objects as a user in the org
@@ -1,5 +1,5 @@
1
- require 'uri'
2
- require 'openssl'
1
+ require 'uri' unless defined?(URI)
2
+ require 'openssl' unless defined?(OpenSSL)
3
3
  require 'chef/server_api'
4
4
 
5
5
  class Chef
@@ -1,4 +1,4 @@
1
1
  # when you change this to double quotes, also update .expeditor/update_version.sh
2
2
  module KnifeECBackup
3
- VERSION = '2.4.7'
3
+ VERSION = '2.4.12'
4
4
  end
@@ -2,7 +2,7 @@ require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "spec_hel
2
2
  require 'chef/knife/ec_base'
3
3
  require 'chef/knife'
4
4
  require 'chef/config'
5
- require 'stringio'
5
+ require 'stringio' unless defined?(StringIO)
6
6
 
7
7
  class Tester < Chef::Knife
8
8
  include Chef::Knife::EcBase
@@ -1,8 +1,8 @@
1
1
  require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "spec_helper"))
2
2
  require 'chef/knife/ec_key_export'
3
3
  require 'sequel'
4
- require 'json'
5
- require 'securerandom'
4
+ require 'json' unless defined?(JSON)
5
+ require 'securerandom' unless defined?(SecureRandom)
6
6
  require 'fakefs/spec_helpers'
7
7
 
8
8
  def user_record(name)
@@ -58,7 +58,7 @@ describe Chef::Knife::EcRestore do
58
58
  @knife.restore_open_invitations("foo")
59
59
  end
60
60
 
61
- it "does NOT fail if an inivitation already exists" do
61
+ it "does NOT fail if an invitation already exists" do
62
62
  make_org "foo"
63
63
  allow(@rest).to receive(:post).with("organizations/foo/association_requests", {"user" => "bob"}).and_return(net_exception(409))
64
64
  allow(@rest).to receive(:post).with("organizations/foo/association_requests", {"user" => "jane"}).and_return(net_exception(409))
@@ -1,7 +1,7 @@
1
1
  require File.expand_path(File.join(File.dirname(__FILE__), "..", "spec_helper"))
2
2
  require 'chef/server'
3
3
  require 'chef/server_api'
4
- require 'stringio'
4
+ require 'stringio' unless defined?(StringIO)
5
5
 
6
6
  describe Chef::Server do
7
7
  before(:each) do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: knife-ec-backup
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.7
4
+ version: 2.4.12
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Keiser
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-19 00:00:00.000000000 Z
11
+ date: 2020-08-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sequel