Changes to client variable name in functions to make sure they work when called by AutoRunScript

git-svn-id: file:///home/svn/framework3/trunk@10941 4d416f70-5f16-0410-b530-b9f4589650da
unstable
Carlos Perez 2010-11-08 01:18:55 +00:00
parent be7d349d60
commit 1042a75282
1 changed files with 29 additions and 0 deletions

View File

@ -0,0 +1,29 @@
@client = client
def met_migrate(pid_to_migrate)
migrate_status = true
begin
print_status("Migrating in to #{pid_to_migrate}")
@client.core.migrate(pid_to_migrate)
print_status("Migration was successful")
rescue::Exception => e
print_error(e)
migrate_status = false
end
return migrate_status
end
def deg_procs
@client.sys.process.processes.each do |p|
print_status("#{p['name']}: #{p['pid']}")
end
end
def find_pids(name)
proc_pid = []
@client.sys.process.get_processes.each do |proc|
if proc['name'].downcase =~ /#{name}/i
proc_pid << proc['pid']
end
end
return proc_pid
end
puts find_pids("svchost").inspect