solusvm 0.8.1 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +2 -0
- data/bin/solusvm +3 -1
- data/lib/solusvm.rb +1 -1
- data/lib/solusvm/server.rb +6 -1
- data/lib/solusvm/version.rb +1 -1
- data/solusvm.gemspec +0 -1
- data/test/fixtures/server_rebuild_success.txt +2 -0
- data/test/helper.rb +1 -1
- data/test/test_server.rb +6 -0
- metadata +8 -20
data/README.markdown
CHANGED
@@ -60,6 +60,7 @@ Command Line Usage
|
|
60
60
|
server-changeplan <vserverid> <newplan>
|
61
61
|
server-resume <vserverid>
|
62
62
|
server-reboot <vserverid>
|
63
|
+
server-rebuild <vserverid> -t myimage
|
63
64
|
server-status <vserverid>
|
64
65
|
server-boot <vserverid>
|
65
66
|
server-create <hostname> <password> -t myimage -k xen -p myplan -i 1
|
@@ -100,6 +101,7 @@ Contributors
|
|
100
101
|
* [Justin Mazzi](http://github.com/jmazzi)
|
101
102
|
* [Maran H.](http://github.com/maran)
|
102
103
|
* [Joshua Priddle](http://github.com/itspriddle)
|
104
|
+
* [Vince Stratful](http://github.com/Vincepbell)
|
103
105
|
|
104
106
|
Note on Patches/Pull Requests
|
105
107
|
-----------------------------
|
data/bin/solusvm
CHANGED
@@ -20,9 +20,9 @@ $shell_methods['server-addip'] = "<vserverid>"
|
|
20
20
|
$shell_methods['server-changeplan'] = "<vserverid> <newplan>"
|
21
21
|
$shell_methods['server-check-exists'] = "<vserverid>"
|
22
22
|
$shell_methods['server-terminate'] = "<vserverid>"
|
23
|
-
|
24
23
|
$shell_methods['node-stats'] = "<nodeid>"
|
25
24
|
$shell_methods['node-available-ips'] = "<nodeid>"
|
25
|
+
$shell_methods['server-rebuild'] = "<vserverid> -t myimage"
|
26
26
|
|
27
27
|
def list_commands
|
28
28
|
puts "Commands:"
|
@@ -137,6 +137,8 @@ else
|
|
137
137
|
stats.each do |k,v|
|
138
138
|
puts "#{k} => #{v}"
|
139
139
|
end
|
140
|
+
when 'server-rebuild'
|
141
|
+
p server.rebuild(ARGV[0], opts[:template])
|
140
142
|
end
|
141
143
|
rescue Exception => e
|
142
144
|
puts "Error: #{e}\n\n"
|
data/lib/solusvm.rb
CHANGED
data/lib/solusvm/server.rb
CHANGED
@@ -66,5 +66,10 @@ module Solusvm
|
|
66
66
|
perform_request(:action => 'vserver-infoall', :vserverid => vid)
|
67
67
|
returned_parameters
|
68
68
|
end
|
69
|
+
|
70
|
+
def rebuild(vid, template)
|
71
|
+
perform_request(:action => 'vserver-rebuild', :vserverid => vid, :template => template)
|
72
|
+
returned_parameters
|
73
|
+
end
|
69
74
|
end
|
70
|
-
end
|
75
|
+
end
|
data/lib/solusvm/version.rb
CHANGED
data/solusvm.gemspec
CHANGED
data/test/helper.rb
CHANGED
data/test/test_server.rb
CHANGED
@@ -30,6 +30,12 @@ class TestServer < Test::Unit::TestCase
|
|
30
30
|
assert ! @server.successful?
|
31
31
|
end
|
32
32
|
|
33
|
+
def test_rebuild
|
34
|
+
FakeWeb.register_uri(:get, "#{base_uri}&action=vserver-rebuild&vserverid=1&template=mytpl", :body => load_response('server_rebuild_success'))
|
35
|
+
assert @server.rebuild(1, "mytpl")
|
36
|
+
assert_equal 'Virtual server is being rebuilt', @server.statusmsg
|
37
|
+
end
|
38
|
+
|
33
39
|
def test_boot
|
34
40
|
FakeWeb.register_uri(:get, "#{base_uri}&action=vserver-boot&vserverid=1", :body => load_response('server_boot_success'))
|
35
41
|
assert @server.boot(1)
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: solusvm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 59
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 0.
|
8
|
+
- 9
|
9
|
+
- 0
|
10
|
+
version: 0.9.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Justin Mazzi
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-11-17 00:00:00 -05:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -62,20 +62,6 @@ dependencies:
|
|
62
62
|
type: :development
|
63
63
|
- !ruby/object:Gem::Dependency
|
64
64
|
requirement: &id004 !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
|
-
requirements:
|
67
|
-
- - ">="
|
68
|
-
- !ruby/object:Gem::Version
|
69
|
-
hash: 3
|
70
|
-
segments:
|
71
|
-
- 0
|
72
|
-
version: "0"
|
73
|
-
version_requirements: *id004
|
74
|
-
name: turn
|
75
|
-
prerelease: false
|
76
|
-
type: :development
|
77
|
-
- !ruby/object:Gem::Dependency
|
78
|
-
requirement: &id005 !ruby/object:Gem::Requirement
|
79
65
|
none: false
|
80
66
|
requirements:
|
81
67
|
- - ~>
|
@@ -86,7 +72,7 @@ dependencies:
|
|
86
72
|
- 8
|
87
73
|
- 7
|
88
74
|
version: 0.8.7
|
89
|
-
version_requirements: *
|
75
|
+
version_requirements: *id004
|
90
76
|
name: rake
|
91
77
|
prerelease: false
|
92
78
|
type: :development
|
@@ -142,6 +128,7 @@ files:
|
|
142
128
|
- test/fixtures/server_info_success.txt
|
143
129
|
- test/fixtures/server_infoall_success.txt
|
144
130
|
- test/fixtures/server_reboot_success.txt
|
131
|
+
- test/fixtures/server_rebuild_success.txt
|
145
132
|
- test/fixtures/server_resume_success.txt
|
146
133
|
- test/fixtures/server_shutdown_success.txt
|
147
134
|
- test/fixtures/server_suspend_success.txt
|
@@ -211,6 +198,7 @@ test_files:
|
|
211
198
|
- test/fixtures/server_info_success.txt
|
212
199
|
- test/fixtures/server_infoall_success.txt
|
213
200
|
- test/fixtures/server_reboot_success.txt
|
201
|
+
- test/fixtures/server_rebuild_success.txt
|
214
202
|
- test/fixtures/server_resume_success.txt
|
215
203
|
- test/fixtures/server_shutdown_success.txt
|
216
204
|
- test/fixtures/server_suspend_success.txt
|