itchy 0.2.2 → 0.2.3
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d34b3f182cd7b8448019d19750207a0d4c756779
|
4
|
+
data.tar.gz: 8c1c95b92299172ceec21f88f3a3cacae89a5a5b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 717b601424734dd320d2edb950d961254c65dfd41e6b40ed7da777308cbe1ba84d4410f648ff203d6ab072e892cfaf9177cdc4600a0b69e4c9ed653b4f8ce630
|
7
|
+
data.tar.gz: bd9e0c13b9a74463a187985d02e71a24090a4abb4585d2aa076d3c28585000cf73c48e0f7f20deb2430f94bcfba53dc7eea5b5748606d52f7b09cbc6206be9db
|
data/bin/itchy
CHANGED
@@ -79,6 +79,8 @@ class ItchyRunnable < Thor
|
|
79
79
|
aliases: '-o', desc: 'Path to a directory where processed events descriptors will be stored'
|
80
80
|
method_option :descriptor_dir, type: :string, default: Itchy::Settings.descriptor_dir,
|
81
81
|
aliases: '-e', desc: 'Path to a directory where appliance descriptors will be stored'
|
82
|
+
method_option :file_permissions, type: :string, default: Itchy::Settings['permissions']['file'],
|
83
|
+
aliases: '-p', desc: 'Sets permissions for all created files'
|
82
84
|
method_option *shared_option_log_to
|
83
85
|
method_option *shared_option_log_level
|
84
86
|
method_option *shared_option_debug
|
data/config/itchy.yml
CHANGED
@@ -13,6 +13,8 @@ module Itchy::EventHandlers
|
|
13
13
|
image_transformer_instance = Itchy::ImageTransformer.new(@options)
|
14
14
|
new_file_name = image_transformer_instance.transform!(vmcatcher_event, vmcatcher_configuration)
|
15
15
|
save_descriptor(create_descriptor(vmcatcher_event, new_file_name), event_name)
|
16
|
+
# file permissions for image
|
17
|
+
set_file_permissions(File.join(@options.output_dir, new_file_name))
|
16
18
|
rescue Itchy::Errors::PrepareEnvError, ArgumentError, Itchy::Errors::ImageTransformationError => ex
|
17
19
|
Itchy::Log.error "[#{self.class.name}] Problem with handling event #{event_name}" \
|
18
20
|
"Event handling failed with #{ex.message}"
|
@@ -54,7 +54,7 @@ module Itchy::EventHandlers
|
|
54
54
|
unless vmcatcher_event.is_a?(Itchy::VmcatcherEvent)
|
55
55
|
fail ArgumentError, '\'vmcatcher_event\' must be an instance of ' \
|
56
56
|
'Itchy::VmcatcherEvent!'
|
57
|
-
|
57
|
+
end
|
58
58
|
end
|
59
59
|
|
60
60
|
# Save created descriptor to descriptor directory.
|
@@ -69,6 +69,19 @@ module Itchy::EventHandlers
|
|
69
69
|
"Attempt failed with error #{ex.message}"
|
70
70
|
fail Itchy::Errors::PrepareEnvError, ex
|
71
71
|
end
|
72
|
+
# file permissions for descriptor
|
73
|
+
set_file_permissions(File.join(@options.descriptor_dir, File.basename(name)))
|
74
|
+
end
|
75
|
+
|
76
|
+
def set_file_permissions(file)
|
77
|
+
Itchy::Log.debug "[#{self.class.name}] Setting file permissions for file #{file} to #{@options.file_permissions}."
|
78
|
+
|
79
|
+
begin
|
80
|
+
::FileUtils.chmod @options.file_permissions.to_i(8), file
|
81
|
+
rescue SystemCallError => ex
|
82
|
+
Itchy::Log.error 'Failed to set permissions!!!'
|
83
|
+
fail Itchy::Errors::PrepareEnvError, ex
|
84
|
+
end
|
72
85
|
end
|
73
86
|
|
74
87
|
protected
|
@@ -64,7 +64,7 @@ module Itchy
|
|
64
64
|
|
65
65
|
# Creates VmcatcherEvent instance.
|
66
66
|
#
|
67
|
-
# @param json
|
67
|
+
# @param json [String] path to file containing json representation
|
68
68
|
# of vmcatcher event
|
69
69
|
#
|
70
70
|
# @return [VmcatcherEvent] instance representing event
|
data/lib/itchy/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: itchy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lubomir Kosaristan
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-
|
12
|
+
date: 2016-02-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: opennebula
|