lxd-common 0.9.0 → 0.9.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 64fff3620f0df985c5890a234085cb238ac72a4592bed8a0880f727d09154c19
|
4
|
+
data.tar.gz: cab1676fb2a6779f0333c4f92215d7dd967455073b48ca78dd449f6ec4606db3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6f38f384ae42e4355d0b04175e89c4d80d2a7267e3abf957eb394ecb73e63f810a6da0439fb6dce7bcb4730a29aa39c41514fbf62aba8f427ecdb3c74d16e1bc
|
7
|
+
data.tar.gz: 9637d609a8fcc1ec77880c0e32886c07d514d203c3ebcb4520cfa4ac571713574892ebbd214468b5166d765baa3fdd86b0dd663ff2c643c115ddb7c117e44b76
|
@@ -31,6 +31,10 @@ module NexusSW
|
|
31
31
|
msg += "STDERR: #{stderr}" if stderr.is_a?(String) && !stderr.empty?
|
32
32
|
raise ::NexusSW::LXD::RestAPI::Error, msg
|
33
33
|
end
|
34
|
+
|
35
|
+
def error?
|
36
|
+
exitstatus != 0
|
37
|
+
end
|
34
38
|
end
|
35
39
|
|
36
40
|
# LocalTransport does not have the users mixin, so code the `su` command on the rest & cli transports directly
|
@@ -11,8 +11,8 @@ module NexusSW
|
|
11
11
|
upload_using_tarball(local_path, path, options) || upload_files_individually(local_path, path, options)
|
12
12
|
end
|
13
13
|
|
14
|
-
def download_folder(path, local_path)
|
15
|
-
download_using_tarball(path, local_path) || download_files_individually(path, local_path)
|
14
|
+
def download_folder(path, local_path, options = {})
|
15
|
+
download_using_tarball(path, local_path, options) || download_files_individually(path, local_path)
|
16
16
|
end
|
17
17
|
|
18
18
|
def upload_files_individually(local_path, path, options = {})
|
@@ -36,7 +36,12 @@ module NexusSW
|
|
36
36
|
end
|
37
37
|
|
38
38
|
# gzip(-z) or bzip2(-j) (these are the only 2 on trusty atm)
|
39
|
-
def download_using_tarball(path, local_path)
|
39
|
+
def download_using_tarball(path, local_path, options = {})
|
40
|
+
if options[:auto_detect] && execute("test -d #{path}").error?
|
41
|
+
download_file(path, File.join(local_path, File.basename(path)))
|
42
|
+
return true
|
43
|
+
end
|
44
|
+
|
40
45
|
return false unless can_archive?
|
41
46
|
tfile = Transport.remote_tempname(container_name)
|
42
47
|
tarball_name = File.join Transport.local_tempdir, File.basename(tfile) + '.tgz'
|
@@ -45,6 +50,7 @@ module NexusSW
|
|
45
50
|
download_file tfile, tarball_name
|
46
51
|
|
47
52
|
Archive::Tar::Minitar.unpack Zlib::GzipReader.new(File.open(tarball_name, 'rb')), local_path
|
53
|
+
return true
|
48
54
|
ensure
|
49
55
|
if tarball_name
|
50
56
|
File.delete tarball_name if File.exist? tarball_name
|
data/lib/nexussw/lxd/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lxd-common
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sean Zachariasen
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-
|
11
|
+
date: 2018-02-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|