cloudkeeper-one 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/cloudkeeper-one.gemspec +1 -1
- data/examples/systemd/cloudkeeper-one.service +18 -0
- data/lib/cloudkeeper/one/appliance_actions/utils/image_download.rb +1 -1
- data/lib/cloudkeeper/one/opennebula/image_handler.rb +4 -1
- data/lib/cloudkeeper/one/version.rb +1 -1
- metadata +3 -3
- data/examples/etc/init.d/cloudkeeper-one +0 -132
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dbc48a405520c660028cc35656d0dd47ff17ac45
|
4
|
+
data.tar.gz: c422f0474a07032eedecff64b8348c6c2f2570bf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2be7e38e80e4a22e5b90768ed1c26dbf4d13e3708b995a8cc037496c68a39dd3678bf1b0aaf891e75372900016dcb55a111154deab09ad05b4a731207b8e98b
|
7
|
+
data.tar.gz: a77fbd53adc364eaeb7a136fce354a5b2c0d2a6596ac1e131def6ec53cf237afd842e44caa5f2c117b17d460914d66d247d7fdbf0a65d3ced4911e800d40b2dc
|
data/cloudkeeper-one.gemspec
CHANGED
@@ -0,0 +1,18 @@
|
|
1
|
+
[Unit]
|
2
|
+
Description="Cloudkeeper-one gRPC Service"
|
3
|
+
After=network.target
|
4
|
+
|
5
|
+
[Service]
|
6
|
+
Type=simple
|
7
|
+
User=cloudkeeper-one
|
8
|
+
Group=cloudkeeper-one
|
9
|
+
PermissionsStartOnly=true
|
10
|
+
Restart=always
|
11
|
+
|
12
|
+
ExecStartPre=/bin/mkdir -p /var/run/cloudkeeper-one /var/lock/cloudkeeper-one /var/log/cloudkeeper-one /var/spool/cloudkeeper-one/appliances
|
13
|
+
ExecStartPre=/bin/chown -R cloudkeeper-one:cloudkeeper-one /var/run/cloudkeeper-one /var/lock/cloudkeeper-one /var/log/cloudkeeper-one /var/spool/cloudkeeper-one
|
14
|
+
|
15
|
+
ExecStart="/opt/cloudkeeper-one/bin/cloudkeeper-one"
|
16
|
+
|
17
|
+
[Install]
|
18
|
+
WantedBy=multi-user.target
|
@@ -27,7 +27,7 @@ module Cloudkeeper
|
|
27
27
|
|
28
28
|
http.request(request) do |response|
|
29
29
|
response.value
|
30
|
-
open(filename, 'w') { |file| response.read_body { |chunk| file.write(chunk) } }
|
30
|
+
File.open(filename, 'w') { |file| response.read_body { |chunk| file.write(chunk) } }
|
31
31
|
end
|
32
32
|
end
|
33
33
|
logger.debug "Image stored into #{filename}"
|
@@ -84,7 +84,10 @@ module Cloudkeeper
|
|
84
84
|
|
85
85
|
timeout do
|
86
86
|
until ready? image
|
87
|
-
|
87
|
+
if error? image
|
88
|
+
delete image
|
89
|
+
raise Cloudkeeper::One::Errors::Opennebula::ResourceStateError, image['TEMPLATE/ERROR']
|
90
|
+
end
|
88
91
|
sleep(Cloudkeeper::One::Opennebula::Handler::API_POLLING_WAIT)
|
89
92
|
end
|
90
93
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cloudkeeper-one
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michal Kimle
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-03-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -327,7 +327,7 @@ files:
|
|
327
327
|
- config/cloudkeeper-one.yml
|
328
328
|
- config/templates/image.erb
|
329
329
|
- config/templates/template.erb
|
330
|
-
- examples/
|
330
|
+
- examples/systemd/cloudkeeper-one.service
|
331
331
|
- lib/cloudkeeper/one.rb
|
332
332
|
- lib/cloudkeeper/one/appliance_actions.rb
|
333
333
|
- lib/cloudkeeper/one/appliance_actions/discard.rb
|
@@ -1,132 +0,0 @@
|
|
1
|
-
#!/bin/sh
|
2
|
-
|
3
|
-
### BEGIN INIT INFO
|
4
|
-
# Provides: cloudkeeper-one
|
5
|
-
# Required-Start: $local_fs $remote_fs $network $syslog $named
|
6
|
-
# Required-Stop: $local_fs $remote_fs $network $syslog $named
|
7
|
-
# Default-Start: 2 3 4 5
|
8
|
-
# Default-Stop: 0 1 6
|
9
|
-
# Short-Description: Start/stop cloudkeeper-one GRPC server
|
10
|
-
# Description: Start the GRPC server for cloudkeeper-one.
|
11
|
-
### END INIT INFO
|
12
|
-
|
13
|
-
run_dir="/var/run/cloudkeeper-one"
|
14
|
-
lock_dir="/var/lock/cloudkeeper-one"
|
15
|
-
log_dir="/var/log/cloudkeeper-one"
|
16
|
-
conf_dir="/etc/cloudkeeper-one"
|
17
|
-
|
18
|
-
omnibus_base_dir="/opt/cloudkeeper-one"
|
19
|
-
embedded_base_dir="$omnibus_base_dir/embedded"
|
20
|
-
embedded_ruby_version=`$embedded_base_dir/bin/ruby -e "puts RUBY_VERSION.split('.').fill('0',2..2).join('.')"`
|
21
|
-
embedded_cloudkeeper_one_version=`$omnibus_base_dir/bin/cloudkeeper-one version`
|
22
|
-
embedded_cloudkeeper_one_dir="$embedded_base_dir/lib/ruby/gems/$embedded_ruby_version/gems/cloudkeeper-one-$embedded_cloudkeeper_one_version"
|
23
|
-
|
24
|
-
user="cloudkeeper-one"
|
25
|
-
cmd="$omnibus_base_dir/bin/cloudkeeper-one"
|
26
|
-
|
27
|
-
name=`basename $0`
|
28
|
-
pid_file="$run_dir/cloudkeeper-one.init.pid"
|
29
|
-
stdout_log="$log_dir/cloudkeeper-one.init.stdout.log"
|
30
|
-
stderr_log="$log_dir/cloudkeeper-one.init.stderr.log"
|
31
|
-
|
32
|
-
retval=0
|
33
|
-
|
34
|
-
get_pid() {
|
35
|
-
cat "$pid_file"
|
36
|
-
}
|
37
|
-
|
38
|
-
setup_dirs() {
|
39
|
-
mkdir -p "$run_dir" "$lock_dir"
|
40
|
-
chown "$user":"$user" "$run_dir" "$lock_dir"
|
41
|
-
}
|
42
|
-
|
43
|
-
is_running() {
|
44
|
-
[ -f "$pid_file" ] && ps `get_pid` > /dev/null 2>&1
|
45
|
-
}
|
46
|
-
|
47
|
-
start() {
|
48
|
-
if is_running; then
|
49
|
-
echo "Already started"
|
50
|
-
else
|
51
|
-
echo "Starting $name ..."
|
52
|
-
setup_dirs
|
53
|
-
|
54
|
-
cd "$run_dir"
|
55
|
-
sudo -u "$user" $cmd >> "$stdout_log" 2>> "$stderr_log" &
|
56
|
-
|
57
|
-
echo $! > "$pid_file"
|
58
|
-
if ! is_running; then
|
59
|
-
echo "Unable to start, see $stdout_log and $stderr_log"
|
60
|
-
retval=1
|
61
|
-
else
|
62
|
-
echo "Started"
|
63
|
-
fi
|
64
|
-
fi
|
65
|
-
}
|
66
|
-
|
67
|
-
stop() {
|
68
|
-
if is_running; then
|
69
|
-
echo "Stopping $name ..."
|
70
|
-
|
71
|
-
kill -s TERM `get_pid`
|
72
|
-
for i in $(seq 1 15); do
|
73
|
-
if ! is_running; then
|
74
|
-
break
|
75
|
-
fi
|
76
|
-
echo -n "."
|
77
|
-
sleep 1
|
78
|
-
done
|
79
|
-
|
80
|
-
echo
|
81
|
-
if is_running; then
|
82
|
-
echo "Not stopped; may still be shutting down or shutdown may have failed"
|
83
|
-
kill -s KILL `get_pid`
|
84
|
-
retval=1
|
85
|
-
else
|
86
|
-
echo "Stopped"
|
87
|
-
if [ -f "$pid_file" ]; then
|
88
|
-
rm "$pid_file"
|
89
|
-
fi
|
90
|
-
fi
|
91
|
-
else
|
92
|
-
echo "Not running"
|
93
|
-
retval=1
|
94
|
-
fi
|
95
|
-
}
|
96
|
-
|
97
|
-
restart(){
|
98
|
-
stop
|
99
|
-
|
100
|
-
if is_running; then
|
101
|
-
echo "Unable to stop, will not attempt to start"
|
102
|
-
retval=1
|
103
|
-
else
|
104
|
-
start
|
105
|
-
fi
|
106
|
-
}
|
107
|
-
|
108
|
-
case "$1" in
|
109
|
-
start)
|
110
|
-
start
|
111
|
-
;;
|
112
|
-
stop)
|
113
|
-
stop
|
114
|
-
;;
|
115
|
-
restart)
|
116
|
-
restart
|
117
|
-
;;
|
118
|
-
status)
|
119
|
-
if is_running; then
|
120
|
-
echo "Running"
|
121
|
-
else
|
122
|
-
echo "Stopped"
|
123
|
-
retval=3
|
124
|
-
fi
|
125
|
-
;;
|
126
|
-
*)
|
127
|
-
echo "Usage: $name {start|stop|restart|status}"
|
128
|
-
retval=1
|
129
|
-
;;
|
130
|
-
esac
|
131
|
-
|
132
|
-
exit $retval
|