fixed based on reviewer's comment.
1. erase wrapper function(remove/exists/mktempfile) from nova.utils. 2. nova-manage service describeresource(->describe_resource) 3. nova-manage service updateresource(->update_resource) 4. erase "my mistake print" statement Additional changes are made at: 1. nova.image.s3.show 2. nova.compute.api.create that's because instances cannot launched without this changes.
This commit is contained in:
@@ -574,7 +574,7 @@ class ServiceCommands(object):
|
||||
return
|
||||
db.service_update(ctxt, svc['id'], {'disabled': True})
|
||||
|
||||
def describeresource(self, host):
|
||||
def describe_resource(self, host):
|
||||
"""describe cpu/memory/hdd info for host."""
|
||||
|
||||
result = rpc.call(context.get_admin_context(),
|
||||
@@ -606,7 +606,7 @@ class ServiceCommands(object):
|
||||
val['memory_mb'],
|
||||
val['local_gb'])
|
||||
|
||||
def updateresource(self, host):
|
||||
def update_resource(self, host):
|
||||
"""update available vcpu/memory/disk info for host."""
|
||||
|
||||
ctxt = context.get_admin_context()
|
||||
@@ -618,9 +618,9 @@ class ServiceCommands(object):
|
||||
if len(service_refs) <= 0:
|
||||
raise exception.Invalid(_('%s is not compute node.') % host)
|
||||
|
||||
result = rpc.call(ctxt,
|
||||
db.queue_get_for(ctxt, FLAGS.compute_topic, host),
|
||||
{"method": "update_available_resource"})
|
||||
rpc.call(ctxt,
|
||||
db.queue_get_for(ctxt, FLAGS.compute_topic, host),
|
||||
{"method": "update_available_resource"})
|
||||
|
||||
|
||||
class LogCommands(object):
|
||||
|
||||
@@ -60,7 +60,6 @@ class SchedulerManager(manager.Manager):
|
||||
host = getattr(self.driver, driver_method)(elevated, *args,
|
||||
**kwargs)
|
||||
except AttributeError, e:
|
||||
print 'manager.attrerr', e
|
||||
host = self.driver.schedule(elevated, topic, *args, **kwargs)
|
||||
|
||||
rpc.cast(context,
|
||||
|
||||
@@ -337,24 +337,6 @@ def str_dict_replace(s, mapping):
|
||||
return s
|
||||
|
||||
|
||||
def mktmpfile(dir):
|
||||
"""create tmpfile under dir, and return filename."""
|
||||
filename = datetime.datetime.utcnow().strftime('%Y%m%d%H%M%S')
|
||||
fpath = os.path.join(dir, filename)
|
||||
open(fpath, 'a+').write(fpath + '\n')
|
||||
return fpath
|
||||
|
||||
|
||||
def exists(filename):
|
||||
"""check file path existence."""
|
||||
return os.path.exists(filename)
|
||||
|
||||
|
||||
def remove(filename):
|
||||
"""remove file."""
|
||||
return os.remove(filename)
|
||||
|
||||
|
||||
class LazyPluggable(object):
|
||||
"""A pluggable backend loaded lazily based on some value."""
|
||||
|
||||
|
||||
Reference in New Issue
Block a user