vmserver 0.3.2 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/lib/vmserver.rb +17 -17
  3. data/vmserver.gemspec +1 -1
  4. metadata +3 -3
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.2
1
+ 0.3.3
data/lib/vmserver.rb CHANGED
@@ -25,7 +25,7 @@ class VMServer
25
25
 
26
26
  def start
27
27
  command = 'start'
28
- vm_command = "#{@base_command} #{command} \'#{@datastore}\'"
28
+ vm_command = %Q{#{@base_command} #{command} '#{@datastore}'}
29
29
  log vm_command
30
30
  result = system(vm_command)
31
31
  result ? log("VM started successfully has been executed.") : log("Error! VM could not be started.")
@@ -40,7 +40,7 @@ class VMServer
40
40
 
41
41
  def stop(mode='soft')
42
42
  command = 'stop'
43
- vm_command = "#{@base_command} #{command} \'#{@datastore}\' #{mode}"
43
+ vm_command = %Q{#{@base_command} #{command} '#{@datastore}' #{mode}}
44
44
  log vm_command
45
45
  result = system(vm_command)
46
46
  result ? log("VM stopped successfully.") : log("Error! VM could not be stopped.")
@@ -55,7 +55,7 @@ class VMServer
55
55
 
56
56
  def reset(mode='soft')
57
57
  command = 'reset'
58
- vm_command = "#{@base_command} #{command} \'#{@datastore}\' #{mode}"
58
+ vm_command = %Q{#{@base_command} #{command} '#{@datastore}' #{mode}}
59
59
  log vm_command
60
60
  result = system(vm_command)
61
61
  result ? log("VM has been resetted.") : log("Error! VM could not be reset.")
@@ -70,7 +70,7 @@ class VMServer
70
70
 
71
71
  def suspend(mode='soft')
72
72
  command = 'reset'
73
- vm_command = "#{@base_command} #{command} \'#{@datastore}\' #{mode}"
73
+ vm_command = %Q{#{@base_command} #{command} '#{@datastore}' #{mode}}
74
74
  log vm_command
75
75
  result = system(vm_command)
76
76
  result ? log("VM has been suspended.") : log("Error! VM could not be suspended.")
@@ -83,7 +83,7 @@ class VMServer
83
83
 
84
84
  def pause
85
85
  command = 'pause'
86
- vm_command = "#{@base_command} #{command} \'#{@datastore}\'"
86
+ vm_command = %Q{#{@base_command} #{command} '#{@datastore}'}
87
87
  log vm_command
88
88
  result = system(vm_command)
89
89
  result ? log("VM has been paused") : log("Error! VM could not be paused.")
@@ -96,7 +96,7 @@ class VMServer
96
96
 
97
97
  def unpause
98
98
  command = 'unpause'
99
- vm_command = "#{@base_command} #{command} \'#{@datastore}\'"
99
+ vm_command = %Q{#{@base_command} #{command} '#{@datastore}'}
100
100
  log vm_command
101
101
  result = system(vm_command)
102
102
  result ? log("VM has been unpaused") : log("Error! VM could not be unpaused.")
@@ -111,7 +111,7 @@ class VMServer
111
111
 
112
112
  def snapshot(name="snapshot_#{Time.now.strftime("%m%d")}")
113
113
  command = 'snapshot'
114
- vm_command = "#{@base_command} #{command} \'#{@datastore}\' #{name}"
114
+ vm_command = %Q{#{@base_command} #{command} '#{@datastore}' #{name}}
115
115
  log vm_command
116
116
  result = system(vm_command)
117
117
  result ? log("SnapShot successful") : log("Error! VM SnapShot failed.")
@@ -124,7 +124,7 @@ class VMServer
124
124
 
125
125
  def revert_to_snapshot(name)
126
126
  command = 'revertToSnapshot'
127
- vm_command = "#{@base_command} #{command} \'#{@datastore}\' #{name}"
127
+ vm_command = %Q{#{@base_command} #{command} '#{@datastore}' #{name}}
128
128
  log vm_command
129
129
  result = system(vm_command)
130
130
  result ? log("Revert SnapShot successful") : log("Error! VM Revert SnapShot failed.")
@@ -137,7 +137,7 @@ class VMServer
137
137
 
138
138
  def delete_snapshot(name)
139
139
  command = 'deleteSnapshot'
140
- vm_command = "#{@base_command} #{command} \'#{@datastore}\' #{name}"
140
+ vm_command = %Q{#{@base_command} #{command} '#{@datastore}' #{name}}
141
141
  log vm_command
142
142
  result = system(vm_command)
143
143
  result ? log("SnapShot deleted successful") : log("Error! VM SnapShot delete failed.")
@@ -152,7 +152,7 @@ class VMServer
152
152
 
153
153
  def mkdir(dir)
154
154
  command = 'createDirectoryInGuest'
155
- vm_command = "#{@base_command} -gu #{@guest_user} -gp #{@guest_password} #{command} \'#{@datastore}\' \'#{dir}\'"
155
+ vm_command = %Q{#{@base_command} -gu #{@guest_user} -gp #{@guest_password} #{command} '#{@datastore}' '#{dir}'}
156
156
  log vm_command
157
157
  result = system(vm_command)
158
158
  result ? log("Directory created successfully in guest.") : log("Error! Directory could not be created.")
@@ -165,7 +165,7 @@ class VMServer
165
165
 
166
166
  def rmdir(dir)
167
167
  command = 'deleteDirectoryInGuest'
168
- vm_command = "#{@base_command} -gu #{@guest_user} -gp #{@guest_password} #{command} \'#{@datastore}\' \'#{dir}\'"
168
+ vm_command = %Q{#{@base_command} -gu #{@guest_user} -gp #{@guest_password} #{command} '#{@datastore}' '#{dir}'}
169
169
  log vm_command
170
170
  result = system(vm_command)
171
171
  result ? log("Directory deleted successfully.") : log("Error! Failed to delete directory.")
@@ -178,7 +178,7 @@ class VMServer
178
178
 
179
179
  def rmfile(file)
180
180
  command = 'deleteFileInGuest'
181
- vm_command = "#{@base_command} -gu #{@guest_user} -gp #{@guest_password} #{command} \'#{@datastore}\' \'#{file}\'"
181
+ vm_command = %Q{#{@base_command} -gu #{@guest_user} -gp #{@guest_password} #{command} '#{@datastore}' '#{file}'}
182
182
  log vm_command
183
183
  result = system(vm_command)
184
184
  result ? log("File deleted successfully.") : log("Error! Failed to delete file.")
@@ -207,7 +207,7 @@ class VMServer
207
207
  # Checks if a file exists in the guest OS
208
208
 
209
209
  def file_exists_in_guest?(file)
210
- vm_command = "#{@base_command} -gu #{@guest_user} -gp #{@guest_password} fileExistsInGuest \'#{datastore}\' \'#{file}\'"
210
+ vm_command = %Q{#{@base_command} -gu #{@guest_user} -gp #{@guest_password} fileExistsInGuest '#{datastore}' '#{file}'}
211
211
  output = system(vm_command)
212
212
  if output =~ /The file exists/
213
213
  return true
@@ -222,7 +222,7 @@ class VMServer
222
222
 
223
223
  def copy_file_from_host_to_guest(src, dest)
224
224
  command = 'copyFileFromHostToGuest'
225
- vm_command = "#{@base_command} -gu #{@guest_user} -gp #{@guest_password} #{command} \'#{@datastore}\' \'#{src}\' \'#{dest}\'"
225
+ vm_command = %Q{#{@base_command} -gu #{@guest_user} -gp #{@guest_password} #{command} '#{@datastore}' '#{src}' '#{dest}'}
226
226
  log vm_command
227
227
  result = system(vm_command)
228
228
  result ? log("Copy successful.") : log("Error! Copy failed.")
@@ -235,7 +235,7 @@ class VMServer
235
235
 
236
236
  def copy_file_from_guest_to_host(src,dest)
237
237
  command = 'copyFileFromGuestToHost'
238
- vm_command = "#{@base_command} -gu #{@guest_user} -gp #{@guest_password} #{command} \'#{@datastore}\' \'#{src}\' \'#{dest}\'"
238
+ vm_command = %Q{#{@base_command} -gu #{@guest_user} -gp #{@guest_password} #{command} '#{@datastore}' '#{src}' '#{dest}'}
239
239
  log vm_command
240
240
  result = system(vm_command)
241
241
  result ? log("Copy successful.") : log("Error! Copy failed.")
@@ -272,7 +272,7 @@ class VMServer
272
272
 
273
273
  def kill_process_in_guest(pid)
274
274
  command = 'killProcessInGuest'
275
- vm_command = "#{@base_command} -gu #{@guest_user} -gp #{guest_password} #{command} \'#{@datastore}\' #{pid}"
275
+ vm_command = %Q{#{@base_command} -gu #{@guest_user} -gp #{guest_password} #{command} '#{@datastore}' #{pid}}
276
276
  log vm_command
277
277
  result = system(vm_command)
278
278
  result ? log("Program executed successfully in guest.") : log("Error! Failed to execute program in guest.")
@@ -285,7 +285,7 @@ class VMServer
285
285
 
286
286
  def capture_screen(output_file)
287
287
  command = 'captureScreen'
288
- vm_command = "#{@base_command} -gu #{@guest_user} -gp #{@guest_password} #{command} \'#{@datastore}\' \'#{output_file}\'"
288
+ vm_command = %Q{#{@base_command} -gu #{@guest_user} -gp #{@guest_password} #{command} '#{@datastore}' '#{output_file}'}
289
289
  log vm_command
290
290
  result = system(vm_command)
291
291
  result ? log("File deleted successfully.") : log("Error! Failed to delete file.")
data/vmserver.gemspec CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{vmserver}
8
- s.version = "0.3.2"
8
+ s.version = "0.3.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Sriram Varahan"]
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vmserver
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 2
10
- version: 0.3.2
9
+ - 3
10
+ version: 0.3.3
11
11
  platform: ruby
12
12
  authors:
13
13
  - Sriram Varahan