python3 has disable LOG.warn.
python3 has disable LOG.warn. So replace LOG.warn with LOG.warning Closes-Bug: #1650457 Change-Id: I532d9faf60a5d6cd84502dc71f9516d6fcad972e
This commit is contained in:
parent
c42a46cf80
commit
62b51cb975
@ -113,7 +113,7 @@ class API(driver.DeploymentDriver):
|
||||
discover_host_meta)
|
||||
msg = (_("Do trustme.sh %s failed!" %
|
||||
discover_host_meta['ip']))
|
||||
LOG.warn(_(msg))
|
||||
LOG.warning(_(msg))
|
||||
fp.write(msg)
|
||||
elif 'is unreachable' in trustme_result:
|
||||
# when host ip was unreachable
|
||||
@ -126,7 +126,7 @@ class API(driver.DeploymentDriver):
|
||||
discover_host_meta)
|
||||
msg = (_("Do trustme.sh %s failed!" %
|
||||
discover_host_meta['ip']))
|
||||
LOG.warn(_(msg))
|
||||
LOG.warning(_(msg))
|
||||
except subprocess.CalledProcessError as e:
|
||||
update_info = {}
|
||||
update_info['status'] = 'DISCOVERY_FAILED'
|
||||
|
@ -1204,7 +1204,7 @@ def upgrade(self, req, cluster_id, version_id, version_patch_id,
|
||||
target_host_os = _get_host_os_version(
|
||||
host_ip, host_meta['root_pwd'])
|
||||
if _cmp_os_version(update_file, target_host_os, host_ip) == -1:
|
||||
LOG.warn(
|
||||
LOG.warning(
|
||||
_("new os version is lower than or equal to "
|
||||
"host %s, don't need to upgrade!" % host_ip))
|
||||
host_meta['messages'] = "New os version is lower than" \
|
||||
@ -1264,7 +1264,7 @@ def upgrade_os(req, version_id, version_patch_id, update_file,
|
||||
for t in threads:
|
||||
t.join()
|
||||
except:
|
||||
LOG.warn(_("Join upgrade thread %s failed!" % t))
|
||||
LOG.warning(_("Join upgrade thread %s failed!" % t))
|
||||
else:
|
||||
for host_info in upgrade_hosts:
|
||||
host = host_info.values()[0]
|
||||
|
@ -51,7 +51,7 @@ class BaseContextMiddleware(wsgi.Middleware):
|
||||
try:
|
||||
request_id = resp.request.context.request_id
|
||||
except AttributeError:
|
||||
LOG.warn(_('Unable to retrieve request id from context'))
|
||||
LOG.warning(_('Unable to retrieve request id from context'))
|
||||
else:
|
||||
resp.headers['x-openstack-request-id'] = 'req-%s' % request_id
|
||||
return resp
|
||||
|
@ -594,14 +594,14 @@ class Controller(controller.BaseController):
|
||||
except exception.NotFound as e:
|
||||
msg = (_("Failed to find cluster to delete: %s") %
|
||||
utils.exception_to_str(e))
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPNotFound(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
except exception.Forbidden as e:
|
||||
msg = (_("Forbidden to delete cluster: %s") %
|
||||
utils.exception_to_str(e))
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPForbidden(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
@ -609,7 +609,7 @@ class Controller(controller.BaseController):
|
||||
msg = (_("cluster %(id)s could not be deleted because "
|
||||
"it is in use: "
|
||||
"%(exc)s") % {"id": id, "exc": utils.exception_to_str(e)})
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPConflict(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
@ -715,26 +715,26 @@ class Controller(controller.BaseController):
|
||||
except exception.Invalid as e:
|
||||
msg = (_("Failed to update cluster metadata. Got error: %s") %
|
||||
utils.exception_to_str(e))
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPBadRequest(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
except exception.NotFound as e:
|
||||
msg = (_("Failed to find cluster to update: %s") %
|
||||
utils.exception_to_str(e))
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPNotFound(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
except exception.Forbidden as e:
|
||||
msg = (_("Forbidden to update cluster: %s") %
|
||||
utils.exception_to_str(e))
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPForbidden(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
except (exception.Conflict, exception.Duplicate) as e:
|
||||
LOG.warn(utils.exception_to_str(e))
|
||||
LOG.warning(utils.exception_to_str(e))
|
||||
raise HTTPConflict(body=_('Cluster operation conflicts'),
|
||||
request=req,
|
||||
content_type='text/plain')
|
||||
|
@ -156,14 +156,14 @@ class Controller(controller.BaseController):
|
||||
except exception.NotFound as e:
|
||||
msg = (_("Failed to find component to delete: %s") %
|
||||
utils.exception_to_str(e))
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPNotFound(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
except exception.Forbidden as e:
|
||||
msg = (_("Forbidden to delete component: %s") %
|
||||
utils.exception_to_str(e))
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPForbidden(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
@ -171,7 +171,7 @@ class Controller(controller.BaseController):
|
||||
msg = (_("component %(id)s could not be "
|
||||
"deleted because it is in use: "
|
||||
"%(exc)s") % {"id": id, "exc": utils.exception_to_str(e)})
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPConflict(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
@ -246,26 +246,26 @@ class Controller(controller.BaseController):
|
||||
except exception.Invalid as e:
|
||||
msg = (_("Failed to update component metadata. Got error: %s") %
|
||||
utils.exception_to_str(e))
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPBadRequest(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
except exception.NotFound as e:
|
||||
msg = (_("Failed to find component to update: %s") %
|
||||
utils.exception_to_str(e))
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPNotFound(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
except exception.Forbidden as e:
|
||||
msg = (_("Forbidden to update component: %s") %
|
||||
utils.exception_to_str(e))
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPForbidden(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
except (exception.Conflict, exception.Duplicate) as e:
|
||||
LOG.warn(utils.exception_to_str(e))
|
||||
LOG.warning(utils.exception_to_str(e))
|
||||
raise HTTPConflict(body=_('Host operation conflicts'),
|
||||
request=req,
|
||||
content_type='text/plain')
|
||||
|
@ -155,14 +155,14 @@ class Controller(controller.BaseController):
|
||||
except exception.NotFound as e:
|
||||
msg = (_("Failed to find config_file to delete: %s") %
|
||||
utils.exception_to_str(e))
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPNotFound(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
except exception.Forbidden as e:
|
||||
msg = (_("Forbidden to delete config_file: %s") %
|
||||
utils.exception_to_str(e))
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPForbidden(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
@ -170,7 +170,7 @@ class Controller(controller.BaseController):
|
||||
msg = (_("config_file %(id)s could not be "
|
||||
"deleted because it is in use: "
|
||||
"%(exc)s") % {"id": id, "exc": utils.exception_to_str(e)})
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPConflict(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
@ -245,26 +245,26 @@ class Controller(controller.BaseController):
|
||||
except exception.Invalid as e:
|
||||
msg = (_("Failed to update config_file metadata. Got error: %s") %
|
||||
utils.exception_to_str(e))
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPBadRequest(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
except exception.NotFound as e:
|
||||
msg = (_("Failed to find config_file to update: %s") %
|
||||
utils.exception_to_str(e))
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPNotFound(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
except exception.Forbidden as e:
|
||||
msg = (_("Forbidden to update config_file: %s") %
|
||||
utils.exception_to_str(e))
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPForbidden(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
except (exception.Conflict, exception.Duplicate) as e:
|
||||
LOG.warn(utils.exception_to_str(e))
|
||||
LOG.warning(utils.exception_to_str(e))
|
||||
raise HTTPConflict(body=_('config_file operation conflicts'),
|
||||
request=req,
|
||||
content_type='text/plain')
|
||||
|
@ -161,12 +161,12 @@ class Controller(controller.BaseController):
|
||||
except exception.NotFound as e:
|
||||
msg = (_("Failed to find config_set to delete: %s") %
|
||||
utils.exception_to_str(e))
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPNotFound(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
except exception.Forbidden as e:
|
||||
LOG.warn(e)
|
||||
LOG.warning(e)
|
||||
raise HTTPForbidden(explanation=e,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
@ -174,7 +174,7 @@ class Controller(controller.BaseController):
|
||||
msg = (_("config_set %(id)s could not be "
|
||||
"deleted because it is in use: "
|
||||
"%(exc)s") % {"id": id, "exc": utils.exception_to_str(e)})
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPConflict(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
@ -249,26 +249,26 @@ class Controller(controller.BaseController):
|
||||
except exception.Invalid as e:
|
||||
msg = (_("Failed to update config_set metadata. Got error: %s") %
|
||||
utils.exception_to_str(e))
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPBadRequest(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
except exception.NotFound as e:
|
||||
msg = (_("Failed to find config_set to update: %s") %
|
||||
utils.exception_to_str(e))
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPNotFound(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
except exception.Forbidden as e:
|
||||
msg = (_("Forbidden to update config_set: %s") %
|
||||
utils.exception_to_str(e))
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPForbidden(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
except (exception.Conflict, exception.Duplicate) as e:
|
||||
LOG.warn(utils.exception_to_str(e))
|
||||
LOG.warning(utils.exception_to_str(e))
|
||||
raise HTTPConflict(body=_('config_set operation conflicts'),
|
||||
request=req,
|
||||
content_type='text/plain')
|
||||
|
@ -227,14 +227,14 @@ class Controller(controller.BaseController):
|
||||
except exception.NotFound as e:
|
||||
msg = (_("Failed to find config to delete: %s") %
|
||||
utils.exception_to_str(e))
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPNotFound(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
except exception.Forbidden as e:
|
||||
msg = (_("Forbidden to delete config: %s") %
|
||||
utils.exception_to_str(e))
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPForbidden(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
@ -242,7 +242,7 @@ class Controller(controller.BaseController):
|
||||
msg = (_("config %(id)s could not be "
|
||||
"deleted because it is in use: "
|
||||
"%(exc)s") % {"id": id, "exc": utils.exception_to_str(e)})
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPConflict(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
|
@ -132,7 +132,7 @@ class Controller(controller.BaseController):
|
||||
% pxe_server_ip
|
||||
(status, output) = commands.getstatusoutput(if_addr_nic_cmd)
|
||||
if status:
|
||||
LOG.warn("get_pxe_server_port error %s." % status)
|
||||
LOG.warning("get_pxe_server_port error %s." % status)
|
||||
return
|
||||
return str(output).split(":")[0].split(".")[0]
|
||||
|
||||
|
@ -365,14 +365,14 @@ class Controller(controller.BaseController):
|
||||
except exception.NotFound as e:
|
||||
msg = (_("Failed to find service_disk to delete: %s") %
|
||||
utils.exception_to_str(e))
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPNotFound(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
except exception.Forbidden as e:
|
||||
msg = (_("Forbidden to delete service_disk: %s") %
|
||||
utils.exception_to_str(e))
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPForbidden(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
@ -380,7 +380,7 @@ class Controller(controller.BaseController):
|
||||
msg = (_("service_disk %(id)s could not be deleted "
|
||||
"because it is in use: "
|
||||
"%(exc)s") % {"id": id, "exc": utils.exception_to_str(e)})
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPConflict(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
@ -398,26 +398,26 @@ class Controller(controller.BaseController):
|
||||
except exception.Invalid as e:
|
||||
msg = (_("Failed to update role metadata. Got error: %s") %
|
||||
utils.exception_to_str(e))
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPBadRequest(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
except exception.NotFound as e:
|
||||
msg = (_("Failed to find role to update: %s") %
|
||||
utils.exception_to_str(e))
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPNotFound(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
except exception.Forbidden as e:
|
||||
msg = (_("Forbidden to update role: %s") %
|
||||
utils.exception_to_str(e))
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPForbidden(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
except (exception.Conflict, exception.Duplicate) as e:
|
||||
LOG.warn(utils.exception_to_str(e))
|
||||
LOG.warning(utils.exception_to_str(e))
|
||||
raise HTTPConflict(body=_('Host operation conflicts'),
|
||||
request=req,
|
||||
content_type='text/plain')
|
||||
@ -593,14 +593,14 @@ class Controller(controller.BaseController):
|
||||
except exception.NotFound as e:
|
||||
msg = (_("Failed to find cinder volume to delete: %s") %
|
||||
utils.exception_to_str(e))
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPNotFound(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
except exception.Forbidden as e:
|
||||
msg = (_("Forbidden to delete cinder volume: %s") %
|
||||
utils.exception_to_str(e))
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPForbidden(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
@ -608,7 +608,7 @@ class Controller(controller.BaseController):
|
||||
msg = (_("cindre volume %(id)s could not "
|
||||
"be deleted because it is in use: "
|
||||
"%(exc)s") % {"id": id, "exc": utils.exception_to_str(e)})
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPConflict(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
@ -682,26 +682,26 @@ class Controller(controller.BaseController):
|
||||
msg = (
|
||||
_("Failed to update cinder_volume metadata. Got error: %s") %
|
||||
utils.exception_to_str(e))
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPBadRequest(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
except exception.NotFound as e:
|
||||
msg = (_("Failed to find cinder_volume to update: %s") %
|
||||
utils.exception_to_str(e))
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPNotFound(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
except exception.Forbidden as e:
|
||||
msg = (_("Forbidden to update cinder_volume: %s") %
|
||||
utils.exception_to_str(e))
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPForbidden(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
except (exception.Conflict, exception.Duplicate) as e:
|
||||
LOG.warn(utils.exception_to_str(e))
|
||||
LOG.warning(utils.exception_to_str(e))
|
||||
raise HTTPConflict(body=_('cinder_volume operation conflicts'),
|
||||
request=req,
|
||||
content_type='text/plain')
|
||||
@ -838,21 +838,21 @@ class Controller(controller.BaseController):
|
||||
msg = (
|
||||
_("Failed to update optical_switch metadata. "
|
||||
"Got error: %s") % utils.exception_to_str(e))
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPBadRequest(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
except exception.NotFound as e:
|
||||
msg = (_("Failed to find optical_switch to update: %s") %
|
||||
utils.exception_to_str(e))
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPNotFound(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
except exception.Forbidden as e:
|
||||
msg = (_("Forbidden to update cinder_volume: %s") %
|
||||
utils.exception_to_str(e))
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPForbidden(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
@ -878,14 +878,14 @@ class Controller(controller.BaseController):
|
||||
except exception.NotFound as e:
|
||||
msg = (_("Failed to find optical switch to delete: %s") %
|
||||
utils.exception_to_str(e))
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPNotFound(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
except exception.Forbidden as e:
|
||||
msg = (_("Forbidden to delete optical switch: %s") %
|
||||
utils.exception_to_str(e))
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPForbidden(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
|
@ -189,26 +189,26 @@ class Controller(controller.BaseController):
|
||||
except exception.Invalid as e:
|
||||
msg = (_("Failed to update template metadata. Got error: %s") %
|
||||
utils.exception_to_str(e))
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPBadRequest(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
except exception.NotFound as e:
|
||||
msg = (_("Failed to find host_template to update: %s") %
|
||||
utils.exception_to_str(e))
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPNotFound(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
except exception.Forbidden as e:
|
||||
msg = (_("Forbidden to update host_template: %s") %
|
||||
utils.exception_to_str(e))
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPForbidden(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
except (exception.Conflict, exception.Duplicate) as e:
|
||||
LOG.warn(utils.exception_to_str(e))
|
||||
LOG.warning(utils.exception_to_str(e))
|
||||
raise HTTPConflict(body=_('host_template operation conflicts'),
|
||||
request=req,
|
||||
content_type='text/plain')
|
||||
|
@ -198,7 +198,7 @@ class Controller(controller.BaseController):
|
||||
ether_nic_names_list: [name1, name2, ...]
|
||||
'''
|
||||
for bond_slaves in bond_slaves_lists:
|
||||
LOG.warn('bond_slaves: %s' % bond_slaves)
|
||||
LOG.warning('bond_slaves: %s' % bond_slaves)
|
||||
if len(set(bond_slaves)) != 2:
|
||||
LOG.error('set(bond_slaves: %s' % set(bond_slaves))
|
||||
msg = (
|
||||
@ -889,7 +889,7 @@ class Controller(controller.BaseController):
|
||||
"The nic name of interface [%s] with same mac,"
|
||||
"please check!" %
|
||||
",".join(same_mac_list))
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
|
||||
# 1-----------------------------------------------------------------
|
||||
# if interface with same 'pci', raise exception
|
||||
@ -1995,7 +1995,7 @@ class Controller(controller.BaseController):
|
||||
discover_host_meta)
|
||||
msg = (_("Do trustme.sh %s failed!" %
|
||||
discover_host_meta['ip']))
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
fp.write(msg)
|
||||
else:
|
||||
mac_info = re.search(r'"mac": ([^,\n]*)', exc_result)
|
||||
@ -2112,7 +2112,7 @@ class Controller(controller.BaseController):
|
||||
for t in threads:
|
||||
t.join()
|
||||
except Exception:
|
||||
LOG.warn(_("Join discover host thread %s failed!" % t))
|
||||
LOG.warning(_("Join discover host thread %s failed!" % t))
|
||||
|
||||
@utils.mutating
|
||||
def discover_host(self, req, host_meta):
|
||||
@ -2154,7 +2154,7 @@ class Controller(controller.BaseController):
|
||||
:raises HTTPBadRequest if x-host-name is missing
|
||||
"""
|
||||
self._enforce(req, 'add_discover_host')
|
||||
LOG.warn("host_meta: %s" % host_meta)
|
||||
LOG.warning("host_meta: %s" % host_meta)
|
||||
if not host_meta.get('ip', None):
|
||||
msg = "IP parameter can not be None."
|
||||
LOG.error(msg)
|
||||
@ -2418,7 +2418,7 @@ class Controller(controller.BaseController):
|
||||
:raises HTTPBadRequest if x-host-name is missing
|
||||
"""
|
||||
self._enforce(req, 'add_pxe_host')
|
||||
LOG.warn("host_meta: %s" % host_meta)
|
||||
LOG.warning("host_meta: %s" % host_meta)
|
||||
if not host_meta.get('mac'):
|
||||
msg = "MAC parameter can not be None."
|
||||
LOG.error(msg)
|
||||
|
@ -365,7 +365,7 @@ class Controller(controller.BaseController):
|
||||
os_install_thread.start()
|
||||
return {"status": "begin install"}
|
||||
else:
|
||||
LOG.warn(_("the cluster %s is installing" % cluster_id))
|
||||
LOG.warning(_("the cluster %s is installing" % cluster_id))
|
||||
return {"status": "Cluster %s is already installing" % cluster_id}
|
||||
|
||||
def _get_uninstall_hosts(self, req, install_meta):
|
||||
|
@ -76,11 +76,11 @@ class Controller(controller.BaseController):
|
||||
# req.context, cluster_id, host_id)
|
||||
# except exception.NotFound:
|
||||
# msg = _("Project with identifier %s not found") % cluster_id
|
||||
# LOG.warn(msg)
|
||||
# LOG.warning(msg)
|
||||
# raise webob.exc.HTTPNotFound(msg)
|
||||
# except exception.Forbidden:
|
||||
# msg = _("Unauthorized project access")
|
||||
# LOG.warn(msg)
|
||||
# LOG.warning(msg)
|
||||
# raise webob.exc.HTTPForbidden(msg)
|
||||
# return dict(members=members)
|
||||
|
||||
|
@ -312,7 +312,7 @@ class Controller(controller.BaseController):
|
||||
msg = (
|
||||
_("When ip range was specified, the CIDR parameter "
|
||||
"can not be empty."))
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPForbidden(msg)
|
||||
else:
|
||||
ip_ranges = eval(network_meta['ip_ranges'])
|
||||
@ -325,7 +325,7 @@ class Controller(controller.BaseController):
|
||||
msg = (
|
||||
_("IP range was not start with 'start:' or "
|
||||
"end with 'end:'."))
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPForbidden(msg)
|
||||
ip_start = ip_pair['start']
|
||||
ip_end = ip_pair['end']
|
||||
@ -389,14 +389,14 @@ class Controller(controller.BaseController):
|
||||
except exception.NotFound as e:
|
||||
msg = (_("Failed to find network to delete: %s") %
|
||||
utils.exception_to_str(e))
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPNotFound(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
except exception.Forbidden as e:
|
||||
msg = (_("Forbidden to delete network: %s") %
|
||||
utils.exception_to_str(e))
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPForbidden(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
@ -404,7 +404,7 @@ class Controller(controller.BaseController):
|
||||
msg = (_("Network %(id)s could not be deleted "
|
||||
"because it is in use: "
|
||||
"%(exc)s") % {"id": id, "exc": utils.exception_to_str(e)})
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPConflict(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
@ -604,7 +604,7 @@ class Controller(controller.BaseController):
|
||||
msg = (
|
||||
_("When ip range was specified, "
|
||||
"the CIDR parameter can not be empty."))
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPForbidden(msg)
|
||||
ip_ranges = eval(network_meta['ip_ranges'])
|
||||
if dataplane_type != 'DATAPLANE':
|
||||
@ -614,7 +614,7 @@ class Controller(controller.BaseController):
|
||||
msg = (
|
||||
_("IP range was not start with 'start:' or "
|
||||
"end with 'end:'."))
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPForbidden(msg)
|
||||
ip_start = ip_pair['start']
|
||||
ip_end = ip_pair['end']
|
||||
@ -637,22 +637,22 @@ class Controller(controller.BaseController):
|
||||
except exception.Invalid as e:
|
||||
msg = (_("Failed to update network metadata. Got error: %s") %
|
||||
utils.exception_to_str(e))
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPBadRequest(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
except exception.NotFound as e:
|
||||
msg = (_("Failed to find network to update: %s") %
|
||||
utils.exception_to_str(e))
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPNotFound(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
except exception.Forbidden as e:
|
||||
LOG.warn(e)
|
||||
LOG.warning(e)
|
||||
raise HTTPForbidden(e)
|
||||
except (exception.Conflict, exception.Duplicate) as e:
|
||||
LOG.warn(utils.exception_to_str(e))
|
||||
LOG.warning(utils.exception_to_str(e))
|
||||
raise HTTPConflict(body=_('Network operation conflicts'),
|
||||
request=req,
|
||||
content_type='text/plain')
|
||||
|
@ -193,7 +193,7 @@ class Controller(controller.BaseController):
|
||||
host_disk_size_m = host_disk_size_m + disk_size_m
|
||||
host_disk_except_os_disk_lists = host_disk_size_m - os_disk_m - \
|
||||
swap_size_m - boot_partition_m - redundant_partiton_m
|
||||
LOG.warn(
|
||||
LOG.warning(
|
||||
'----start----host_disk_except_os_disk_lists: %s -----end--' %
|
||||
host_disk_except_os_disk_lists)
|
||||
return host_disk_except_os_disk_lists
|
||||
@ -203,7 +203,7 @@ class Controller(controller.BaseController):
|
||||
paras['db_lv_size'], paras['glance_lv_size'] , paras['disk_size']
|
||||
'''
|
||||
disk_size = paras.get('disk_size', None)
|
||||
LOG.warn('--------disk_size:----- %s' % disk_size)
|
||||
LOG.warning('--------disk_size:----- %s' % disk_size)
|
||||
if disk_size:
|
||||
disk_size_m = int(disk_size)
|
||||
else:
|
||||
@ -337,7 +337,7 @@ class Controller(controller.BaseController):
|
||||
else:
|
||||
argws['nova_lv_size'] = nova_lv_size
|
||||
argws['disk_size'] = host_disk_db_glance_nova_size['disk_size']
|
||||
LOG.warn(
|
||||
LOG.warning(
|
||||
'--------host(%s) check_host_validity argws:----- %s' %
|
||||
(host_id, argws))
|
||||
self._check_host_validity(**argws)
|
||||
@ -511,7 +511,7 @@ class Controller(controller.BaseController):
|
||||
host_disk_db_glance_nova_size['nova_lv_size'] = max(nova_lv_size)
|
||||
else:
|
||||
host_disk_db_glance_nova_size['nova_lv_size'] = 0
|
||||
LOG.warn('--------host(%s)disk_db_glance_nova_size:----- %s' %
|
||||
LOG.warning('--------host(%s)disk_db_glance_nova_size:----- %s' %
|
||||
(host_id, host_disk_db_glance_nova_size))
|
||||
return host_disk_db_glance_nova_size
|
||||
|
||||
@ -681,21 +681,21 @@ class Controller(controller.BaseController):
|
||||
except exception.NotFound as e:
|
||||
msg = (_("Failed to find role to delete: %s") %
|
||||
utils.exception_to_str(e))
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPNotFound(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
except exception.Forbidden as e:
|
||||
msg = (_("Forbidden to delete role: %s") %
|
||||
utils.exception_to_str(e))
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPForbidden(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
except exception.InUseByStore as e:
|
||||
msg = (_("role %(id)s could not be deleted because it is in use: "
|
||||
"%(exc)s") % {"id": id, "exc": utils.exception_to_str(e)})
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPConflict(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
@ -878,26 +878,26 @@ class Controller(controller.BaseController):
|
||||
except exception.Invalid as e:
|
||||
msg = (_("Failed to update role metadata. Got error: %s") %
|
||||
utils.exception_to_str(e))
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPBadRequest(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
except exception.NotFound as e:
|
||||
msg = (_("Failed to find role to update: %s") %
|
||||
utils.exception_to_str(e))
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPNotFound(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
except exception.Forbidden as e:
|
||||
msg = (_("Forbidden to update role: %s") %
|
||||
utils.exception_to_str(e))
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPForbidden(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
except (exception.Conflict, exception.Duplicate) as e:
|
||||
LOG.warn(utils.exception_to_str(e))
|
||||
LOG.warning(utils.exception_to_str(e))
|
||||
raise HTTPConflict(body=_('Host operation conflicts'),
|
||||
request=req,
|
||||
content_type='text/plain')
|
||||
|
@ -160,14 +160,14 @@ class Controller(controller.BaseController):
|
||||
except exception.NotFound as e:
|
||||
msg = (_("Failed to find service to delete: %s") %
|
||||
utils.exception_to_str(e))
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPNotFound(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
except exception.Forbidden as e:
|
||||
msg = (_("Forbidden to delete service: %s") %
|
||||
utils.exception_to_str(e))
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPForbidden(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
@ -175,7 +175,7 @@ class Controller(controller.BaseController):
|
||||
msg = (_("service %(id)s could not be deleted "
|
||||
"because it is in use: "
|
||||
"%(exc)s") % {"id": id, "exc": utils.exception_to_str(e)})
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPConflict(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
@ -250,26 +250,26 @@ class Controller(controller.BaseController):
|
||||
except exception.Invalid as e:
|
||||
msg = (_("Failed to update service metadata. Got error: %s") %
|
||||
utils.exception_to_str(e))
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPBadRequest(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
except exception.NotFound as e:
|
||||
msg = (_("Failed to find service to update: %s") %
|
||||
utils.exception_to_str(e))
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPNotFound(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
except exception.Forbidden as e:
|
||||
msg = (_("Forbidden to update service: %s") %
|
||||
utils.exception_to_str(e))
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPForbidden(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
except (exception.Conflict, exception.Duplicate) as e:
|
||||
LOG.warn(utils.exception_to_str(e))
|
||||
LOG.warning(utils.exception_to_str(e))
|
||||
raise HTTPConflict(body=_('Host operation conflicts'),
|
||||
request=req,
|
||||
content_type='text/plain')
|
||||
|
@ -163,26 +163,26 @@ class Controller(controller.BaseController):
|
||||
except exception.Invalid as e:
|
||||
msg = (_("Failed to update template metadata. Got error: %s") %
|
||||
utils.exception_to_str(e))
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPBadRequest(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
except exception.NotFound as e:
|
||||
msg = (_("Failed to find template to update: %s") %
|
||||
utils.exception_to_str(e))
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPNotFound(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
except exception.Forbidden as e:
|
||||
msg = (_("Forbidden to update template: %s") %
|
||||
utils.exception_to_str(e))
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPForbidden(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
except (exception.Conflict, exception.Duplicate) as e:
|
||||
LOG.warn(utils.exception_to_str(e))
|
||||
LOG.warning(utils.exception_to_str(e))
|
||||
raise HTTPConflict(body=_('template operation conflicts'),
|
||||
request=req,
|
||||
content_type='text/plain')
|
||||
|
@ -152,14 +152,14 @@ class Controller(controller.BaseController):
|
||||
except exception.NotFound as e:
|
||||
msg = (_("Failed to find version patch to delete: %s") %
|
||||
utils.exception_to_str(e))
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPNotFound(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
except exception.Forbidden as e:
|
||||
msg = (_("Forbidden to delete version patch: %s") %
|
||||
utils.exception_to_str(e))
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPForbidden(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
@ -167,7 +167,7 @@ class Controller(controller.BaseController):
|
||||
msg = (_("version patch %(id)s could not be deleted "
|
||||
"because it is in use: " "%(exc)s")
|
||||
% {"id": id, "exc": utils.exception_to_str(e)})
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPConflict(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
@ -255,26 +255,26 @@ class Controller(controller.BaseController):
|
||||
except exception.Invalid as e:
|
||||
msg = (_("Failed to update version patch. Got error: %s")
|
||||
% utils.exception_to_str(e))
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPBadRequest(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
except exception.NotFound as e:
|
||||
msg = (_("Failed to find version patch to update: %s") %
|
||||
utils.exception_to_str(e))
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPNotFound(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
except exception.Forbidden as e:
|
||||
msg = (_("Forbidden to update version patch: %s") %
|
||||
utils.exception_to_str(e))
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPForbidden(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
except (exception.Conflict, exception.Duplicate) as e:
|
||||
LOG.warn(utils.exception_to_str(e))
|
||||
LOG.warning(utils.exception_to_str(e))
|
||||
raise HTTPConflict(body=_('Host operation conflicts'),
|
||||
request=req,
|
||||
content_type='text/plain')
|
||||
|
@ -152,14 +152,14 @@ class Controller(controller.BaseController):
|
||||
except exception.NotFound as e:
|
||||
msg = (_("Failed to find version to delete: %s") %
|
||||
utils.exception_to_str(e))
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPNotFound(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
except exception.Forbidden as e:
|
||||
msg = (_("Forbidden to delete role: %s") %
|
||||
utils.exception_to_str(e))
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPForbidden(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
@ -168,7 +168,7 @@ class Controller(controller.BaseController):
|
||||
_("version %(id)s could not be deleted because "
|
||||
"it is in use: " "%(exc)s")
|
||||
% {"id": id, "exc": utils.exception_to_str(e)})
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPConflict(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
@ -241,26 +241,26 @@ class Controller(controller.BaseController):
|
||||
except exception.Invalid as e:
|
||||
msg = (_("Failed to update version metadata. Got error: %s") %
|
||||
utils.exception_to_str(e))
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPBadRequest(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
except exception.NotFound as e:
|
||||
msg = (_("Failed to find version to update: %s") %
|
||||
utils.exception_to_str(e))
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPNotFound(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
except exception.Forbidden as e:
|
||||
msg = (_("Forbidden to update version: %s") %
|
||||
utils.exception_to_str(e))
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise HTTPForbidden(explanation=msg,
|
||||
request=req,
|
||||
content_type="text/plain")
|
||||
except (exception.Conflict, exception.Duplicate) as e:
|
||||
LOG.warn(utils.exception_to_str(e))
|
||||
LOG.warning(utils.exception_to_str(e))
|
||||
raise HTTPConflict(body=_('Host operation conflicts'),
|
||||
request=req,
|
||||
content_type='text/plain')
|
||||
|
@ -278,7 +278,7 @@ def get_endpoint(service_catalog, service_type='image', endpoint_region=None,
|
||||
s_type = service['type']
|
||||
except KeyError:
|
||||
msg = _('Encountered service with no "type": %s') % s_type
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
continue
|
||||
|
||||
if s_type == service_type:
|
||||
|
@ -660,7 +660,7 @@ def validate_key_cert(key_file, cert_file):
|
||||
data = str(uuid.uuid4())
|
||||
digest = CONF.digest_algorithm
|
||||
if digest == 'sha1':
|
||||
LOG.warn('The FIPS (FEDERAL INFORMATION PROCESSING STANDARDS)'
|
||||
LOG.warning('The FIPS (FEDERAL INFORMATION PROCESSING STANDARDS)'
|
||||
' state that the SHA-1 is not suitable for'
|
||||
' general-purpose digital signature applications (as'
|
||||
' specified in FIPS 186-3) that require 112 bits of'
|
||||
@ -888,12 +888,12 @@ def valid_cidr(cidr):
|
||||
try:
|
||||
netmask_cidr = int(cidr_division[1])
|
||||
except ValueError:
|
||||
LOG.warn(netmask_err_msg)
|
||||
LOG.warning(netmask_err_msg)
|
||||
raise exc.HTTPBadRequest(explanation=netmask_err_msg)
|
||||
|
||||
if (netmask_cidr < 0 and
|
||||
netmask_cidr > 32):
|
||||
LOG.warn(netmask_err_msg)
|
||||
LOG.warning(netmask_err_msg)
|
||||
raise exc.HTTPBadRequest(explanation=netmask_err_msg)
|
||||
|
||||
validate_ip_format(cidr_division[0])
|
||||
|
@ -315,7 +315,7 @@ class Server(object):
|
||||
self.stale_children.remove(pid)
|
||||
LOG.info(_LI('Removed stale child %s') % pid)
|
||||
else:
|
||||
LOG.warn(_LW('Unrecognised child %s') % pid)
|
||||
LOG.warning(_LW('Unrecognised child %s') % pid)
|
||||
|
||||
def _verify_and_respawn_children(self, pid, status):
|
||||
if len(self.stale_children) == 0:
|
||||
|
@ -72,7 +72,7 @@ def _retry_on_deadlock(exc):
|
||||
"""Decorator to retry a DB API call if Deadlock was received."""
|
||||
|
||||
if isinstance(exc, db_exception.DBDeadlock):
|
||||
LOG.warn(_LW("Deadlock detected. Retrying..."))
|
||||
LOG.warning(_LW("Deadlock detected. Retrying..."))
|
||||
return True
|
||||
return False
|
||||
|
||||
@ -352,7 +352,7 @@ def check_ip_ranges(ip_ranges_one,available_ip_list):
|
||||
if inter_tmp > ip_ranges_end_inter:
|
||||
msg = "warning:The IP address assigned \
|
||||
by IP ranges is already insufficient."
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
break
|
||||
else:
|
||||
return [True, ip_tmp]
|
||||
@ -3193,7 +3193,7 @@ def _paginate_query(query, model, limit, sort_keys, marker=None,
|
||||
if 'id' not in sort_keys:
|
||||
# TODO(justinsb): If this ever gives a false-positive, check
|
||||
# the actual primary key, rather than assuming its id
|
||||
LOG.warn(_LW('Id not in sort_keys; is sort_keys unique?'))
|
||||
LOG.warning(_LW('Id not in sort_keys; is sort_keys unique?'))
|
||||
|
||||
assert(not (sort_dir and sort_dirs))
|
||||
|
||||
|
@ -49,11 +49,11 @@ class OrchestrationManager():
|
||||
host_list = [host for host in host_list_generator if hasattr(
|
||||
host, "role_status") and host.role_status == "active"]
|
||||
if not host_list:
|
||||
LOG.warn("No installed active node in cluster")
|
||||
LOG.warning("No installed active node in cluster")
|
||||
host_list = [host for host in host_list
|
||||
if host.discover_mode == "PXE"]
|
||||
if not host_list:
|
||||
LOG.warn("No pxe discover successful node in cluster")
|
||||
LOG.warning("No pxe discover successful node in cluster")
|
||||
for host in host_list:
|
||||
host_info = daisy_client.hosts.get(host.id)
|
||||
if hasattr(host_info, "role") and ["COMPUTER"] == host_info.role \
|
||||
@ -97,7 +97,7 @@ class OrchestrationManager():
|
||||
host_info.virtio_queue_size = active_compute_host.virtio_queue_size
|
||||
host_info.dvs_config_type = active_compute_host.dvs_config_type
|
||||
else:
|
||||
LOG.warn("No installed active computer node in cluster")
|
||||
LOG.warning("No installed active computer node in cluster")
|
||||
return None
|
||||
|
||||
if active_compute_host:
|
||||
@ -144,19 +144,19 @@ class OrchestrationManager():
|
||||
if new_interface_count != compute_interface_count:
|
||||
msg = "%s and new host interface number are different" %\
|
||||
(compute_host.name)
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
continue
|
||||
if host_info.cpu['total'] != compute_host.cpu['total']:
|
||||
msg = "%s and new host cpu total numbers are different" %\
|
||||
(compute_host.name)
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
continue
|
||||
compute_numa_cpus = utils.get_numa_node_cpus(
|
||||
(compute_host.cpu or {}))
|
||||
if compute_numa_cpus != host_numa_cpus:
|
||||
msg = "%s and new host numa cpus are different" %\
|
||||
compute_host.name
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
continue
|
||||
active_compu_memory_str = str(compute_host.memory['total'])
|
||||
active_compu_memory_size =\
|
||||
@ -164,7 +164,7 @@ class OrchestrationManager():
|
||||
# host memory can't be lower than the installed host memory size-1G
|
||||
if memory_size_b_int < active_compu_memory_size - 1024 * 1024:
|
||||
msg = "new host memory is lower than %s" % compute_host.name
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
continue
|
||||
is_isomorphic = self._check_interface_isomorphic(
|
||||
new_interfaces, compute_host)
|
||||
@ -190,13 +190,13 @@ class OrchestrationManager():
|
||||
and (interface['max_speed'] != max_speed):
|
||||
msg = "%s and new host %s max speed are different" \
|
||||
% (active_host.name, interface['name'])
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
return False
|
||||
elif (interface['name'] == compute_interface['name']) and\
|
||||
(interface['pci'] != compute_interface['pci']):
|
||||
msg = "%s and new host %s pci are different" \
|
||||
% (active_host.name, interface['name'])
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
return False
|
||||
if not is_isomorphic:
|
||||
return False
|
||||
|
@ -62,12 +62,12 @@ class Controller(object):
|
||||
return self.db_api.config_file_get_all(context, filters=filters,
|
||||
**params)
|
||||
except exception.NotFound:
|
||||
LOG.warn(_LW("Invalid marker. Config_file %(id)s could not be "
|
||||
LOG.warning(_LW("Invalid marker. Config_file %(id)s could not be "
|
||||
"found.") % {'id': params.get('marker')})
|
||||
msg = _("Invalid marker. Config_file could not be found.")
|
||||
raise exc.HTTPBadRequest(explanation=msg)
|
||||
except exception.Forbidden:
|
||||
LOG.warn(_LW("Access denied to config_file %(id)s but returning "
|
||||
LOG.warning(_LW("Access denied to config_file %(id)s but returned "
|
||||
"'not found'") % {'id': params.get('marker')})
|
||||
msg = _("Invalid marker. config_file could not be found.")
|
||||
raise exc.HTTPBadRequest(explanation=msg)
|
||||
@ -251,7 +251,7 @@ class Controller(object):
|
||||
except exception.Duplicate:
|
||||
msg = _("config_file with identifier %s already exists!") % \
|
||||
config_file_id
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
return exc.HTTPConflict(msg)
|
||||
except exception.Invalid as e:
|
||||
msg = (_("Failed to add config_file metadata. "
|
||||
|
@ -62,12 +62,12 @@ class Controller(object):
|
||||
return self.db_api.config_set_get_all(context, filters=filters,
|
||||
**params)
|
||||
except exception.NotFound:
|
||||
LOG.warn(_LW("Invalid marker. Config_set %(id)s could not be "
|
||||
LOG.warning(_LW("Invalid marker. Config_set %(id)s could not be "
|
||||
"found.") % {'id': params.get('marker')})
|
||||
msg = _("Invalid marker. Config_set could not be found.")
|
||||
raise exc.HTTPBadRequest(explanation=msg)
|
||||
except exception.Forbidden:
|
||||
LOG.warn(_LW("Access denied to config_set %(id)s but returning "
|
||||
LOG.warning(_LW("Access denied to config_set %(id)s but returning "
|
||||
"'not found'") % {'id': params.get('marker')})
|
||||
msg = _("Invalid marker. config_set could not be found.")
|
||||
raise exc.HTTPBadRequest(explanation=msg)
|
||||
@ -251,7 +251,7 @@ class Controller(object):
|
||||
except exception.Duplicate:
|
||||
msg = _("config_set with identifier %s already exists!") % \
|
||||
config_set_id
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
return exc.HTTPConflict(msg)
|
||||
except exception.Invalid as e:
|
||||
msg = (_("Failed to add config_set metadata. "
|
||||
|
@ -62,12 +62,12 @@ class Controller(object):
|
||||
return self.db_api.config_get_all(context, filters=filters,
|
||||
**params)
|
||||
except exception.NotFound:
|
||||
LOG.warn(_LW("Invalid marker. Config %(id)s could not be "
|
||||
LOG.warning(_LW("Invalid marker. Config %(id)s could not be "
|
||||
"found.") % {'id': params.get('marker')})
|
||||
msg = _("Invalid marker. Config could not be found.")
|
||||
raise exc.HTTPBadRequest(explanation=msg)
|
||||
except exception.Forbidden:
|
||||
LOG.warn(_LW("Access denied to config %(id)s but returning "
|
||||
LOG.warning(_LW("Access denied to config %(id)s but returning "
|
||||
"'not found'") % {'id': params.get('marker')})
|
||||
msg = _("Invalid marker. config could not be found.")
|
||||
raise exc.HTTPBadRequest(explanation=msg)
|
||||
@ -248,7 +248,7 @@ class Controller(object):
|
||||
return config_data
|
||||
except exception.Duplicate:
|
||||
msg = _("config with identifier %s already exists!") % config_id
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
return exc.HTTPConflict(msg)
|
||||
except exception.Invalid as e:
|
||||
msg = (_("Failed to add config metadata. "
|
||||
|
@ -233,7 +233,7 @@ class Controller(object):
|
||||
return service_disk_data
|
||||
except exception.Duplicate:
|
||||
msg = _("node with identifier %s already exists!") % id
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
return exc.HTTPConflict(msg)
|
||||
except exception.Invalid as e:
|
||||
msg = (_("Failed to add node metadata. "
|
||||
@ -359,12 +359,12 @@ class Controller(object):
|
||||
return self.db_api.service_disk_list(context, filters=filters,
|
||||
**params)
|
||||
except exception.NotFound:
|
||||
LOG.warn(_LW("Invalid marker. service_disk %(id)s could not be "
|
||||
LOG.warning(_LW("Invalid marker. service_disk %(id)s could not be "
|
||||
"found.") % {'id': params.get('marker')})
|
||||
msg = _("Invalid marker. service_disk could not be found.")
|
||||
raise exc.HTTPBadRequest(explanation=msg)
|
||||
except exception.Forbidden:
|
||||
LOG.warn(_LW("Access denied to service_disk %(id)s but returning "
|
||||
LOG.warning(_LW("Access denied service_disk %(id)s but returned "
|
||||
"'not found'") % {'id': params.get('marker')})
|
||||
msg = _("Invalid marker. service_disk could not be found.")
|
||||
raise exc.HTTPBadRequest(explanation=msg)
|
||||
@ -431,7 +431,7 @@ class Controller(object):
|
||||
return cinder_volume_data
|
||||
except exception.Duplicate:
|
||||
msg = _("cinder_volume with identifier %s already exists!") % id
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
return exc.HTTPConflict(msg)
|
||||
except exception.Invalid as e:
|
||||
msg = (_("Failed to add cinder_volume metadata. "
|
||||
@ -565,12 +565,12 @@ class Controller(object):
|
||||
return self.db_api.cinder_volume_list(context, filters=filters,
|
||||
**params)
|
||||
except exception.NotFound:
|
||||
LOG.warn(_LW("Invalid marker. cinder_volume %(id)s could not be "
|
||||
LOG.warning(_LW("Invalid marker.cinder_volume %(id)s not "
|
||||
"found.") % {'id': params.get('marker')})
|
||||
msg = _("Invalid marker. cinder_volume could not be found.")
|
||||
raise exc.HTTPBadRequest(explanation=msg)
|
||||
except exception.Forbidden:
|
||||
LOG.warn(_LW("Access denied to cinder_volume %(id)s but returning "
|
||||
LOG.warning(_LW("Access denied cinder_volume %(id)s but returned "
|
||||
"'not found'") % {'id': params.get('marker')})
|
||||
msg = _("Invalid marker. cinder_volume could not be found.")
|
||||
raise exc.HTTPBadRequest(explanation=msg)
|
||||
@ -584,14 +584,14 @@ class Controller(object):
|
||||
return self.db_api.optical_switch_list(context, filters=filters,
|
||||
**params)
|
||||
except exception.NotFound:
|
||||
LOG.warn(_LW("Invalid marker. optical switch %(id)s "
|
||||
LOG.warning(_LW("Invalid marker. optical switch %(id)s "
|
||||
"could not be found.") %
|
||||
{'id': params.get('marker')})
|
||||
msg = _("Invalid marker. optical switch "
|
||||
"could not be found.")
|
||||
raise exc.HTTPBadRequest(explanation=msg)
|
||||
except exception.Forbidden:
|
||||
LOG.warn(_LW("Access denied to optical_switch %(id)s "
|
||||
LOG.warning(_LW("Access denied to optical_switch %(id)s "
|
||||
"but returning 'not found'") %
|
||||
{'id': params.get('marker')})
|
||||
msg = _("Invalid marker. optical_switch "
|
||||
|
@ -70,12 +70,12 @@ class Controller(object):
|
||||
return self.db_api.host_get_all(context, filters=filters,
|
||||
**params)
|
||||
except exception.NotFound:
|
||||
LOG.warn(_LW("Invalid marker. Host %(id)s could not be "
|
||||
LOG.warning(_LW("Invalid marker. Host %(id)s could not be "
|
||||
"found.") % {'id': params.get('marker')})
|
||||
msg = _("Invalid marker. Host could not be found.")
|
||||
raise exc.HTTPBadRequest(explanation=msg)
|
||||
except exception.Forbidden:
|
||||
LOG.warn(_LW("Access denied to host %(id)s but returning "
|
||||
LOG.warning(_LW("Access denied to host %(id)s but returning "
|
||||
"'not found'") % {'id': params.get('marker')})
|
||||
msg = _("Invalid marker. Host could not be found.")
|
||||
raise exc.HTTPBadRequest(explanation=msg)
|
||||
@ -89,12 +89,12 @@ class Controller(object):
|
||||
return self.db_api.cluster_get_all(context, filters=filters,
|
||||
**params)
|
||||
except exception.NotFound:
|
||||
LOG.warn(_LW("Invalid marker. Cluster %(id)s could not be "
|
||||
LOG.warning(_LW("Invalid marker. Cluster %(id)s could not be "
|
||||
"found.") % {'id': params.get('marker')})
|
||||
msg = _("Invalid marker. Cluster could not be found.")
|
||||
raise exc.HTTPBadRequest(explanation=msg)
|
||||
except exception.Forbidden:
|
||||
LOG.warn(_LW("Access denied to cluster %(id)s but returning "
|
||||
LOG.warning(_LW("Access denied to cluster %(id)s but returning "
|
||||
"'not found'") % {'id': params.get('marker')})
|
||||
msg = _("Invalid marker. Cluster could not be found.")
|
||||
raise exc.HTTPBadRequest(explanation=msg)
|
||||
@ -307,7 +307,7 @@ class Controller(object):
|
||||
return host_data
|
||||
except exception.Duplicate:
|
||||
msg = _("node with identifier %s already exists!") % host_id
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
return exc.HTTPConflict(msg)
|
||||
except exception.Invalid as e:
|
||||
msg = (_("Failed to add node metadata. "
|
||||
@ -514,12 +514,12 @@ class Controller(object):
|
||||
req.context, filters)
|
||||
return host_interfaces
|
||||
except exception.NotFound:
|
||||
LOG.warn(_LW("Invalid marker. template %(id)s could not be "
|
||||
LOG.warning(_LW("Invalid marker. template %(id)s could not be "
|
||||
"found.") % {'id': params.get('marker')})
|
||||
msg = _("Invalid marker. template could not be found.")
|
||||
raise exc.HTTPBadRequest(explanation=msg)
|
||||
except exception.Forbidden:
|
||||
LOG.warn(_LW("Access denied to template %(id)s but returning "
|
||||
LOG.warning(_LW("Access denied to template %(id)s but returning "
|
||||
"'not found'") % {'id': params.get('marker')})
|
||||
msg = _("Invalid marker. template could not be found.")
|
||||
raise exc.HTTPBadRequest(explanation=msg)
|
||||
@ -535,14 +535,14 @@ class Controller(object):
|
||||
req.context,
|
||||
interface_id, network_id)
|
||||
except exception.NotFound:
|
||||
LOG.warn(_LW("Invalid marker. Assigned_network with interface %("
|
||||
LOG.warning(_LW("Invalid marker.Assigned_network with if %("
|
||||
"interface_id)s and network %(network_id)s"
|
||||
" could not be found.") % {
|
||||
'interface_id': interface_id, 'network_id': network_id})
|
||||
msg = _("Invalid marker. Assigned_network could not be found.")
|
||||
raise exc.HTTPBadRequest(explanation=msg)
|
||||
except exception.Forbidden:
|
||||
LOG.warn(_LW("Access denied for assigned_network with interface %("
|
||||
LOG.warning(_LW("Access denied for assigned_network with if %("
|
||||
"interface_id)s "
|
||||
"and network %(network_id)s") % {
|
||||
'interface_id': interface_id, 'network_id': network_id})
|
||||
@ -592,7 +592,7 @@ class Controller(object):
|
||||
except exception.Duplicate:
|
||||
msg = _("node with identifier %s already exists!") % \
|
||||
discover_host_id
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
return exc.HTTPConflict(msg)
|
||||
except exception.Invalid as e:
|
||||
msg = (_("Failed to add node metadata. "
|
||||
@ -646,12 +646,12 @@ class Controller(object):
|
||||
nodes = self.db_api.discover_host_get_all(req.context,
|
||||
**params)
|
||||
except exception.NotFound:
|
||||
LOG.warn(_LW("Invalid marker. Host %(id)s could not be "
|
||||
LOG.warning(_LW("Invalid marker. Host %(id)s could not be "
|
||||
"found.") % {'id': params.get('marker')})
|
||||
msg = _("Invalid marker. Host could not be found.")
|
||||
raise exc.HTTPBadRequest(explanation=msg)
|
||||
except exception.Forbidden:
|
||||
LOG.warn(_LW("Access denied to host %(id)s but returning "
|
||||
LOG.warning(_LW("Access denied to host %(id)s but returning "
|
||||
"'not found'") % {'id': params.get('marker')})
|
||||
msg = _("Invalid marker. Host could not be found.")
|
||||
raise exc.HTTPBadRequest(explanation=msg)
|
||||
@ -787,7 +787,7 @@ class Controller(object):
|
||||
return cluster_data
|
||||
except exception.Duplicate:
|
||||
msg = _("cluster with identifier %s already exists!") % cluster_id
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
return exc.HTTPConflict(msg)
|
||||
except exception.Invalid as e:
|
||||
msg = (_("Failed to add cluster metadata. "
|
||||
@ -974,7 +974,7 @@ class Controller(object):
|
||||
except exception.Duplicate:
|
||||
msg = (_("component with identifier %s already exists!")
|
||||
% component_id)
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
return exc.HTTPConflict(msg)
|
||||
except exception.Invalid as e:
|
||||
msg = (_("Failed to add component metadata. "
|
||||
@ -1025,12 +1025,12 @@ class Controller(object):
|
||||
return self.db_api.component_get_all(context, filters=filters,
|
||||
**params)
|
||||
except exception.NotFound:
|
||||
LOG.warn(_LW("Invalid marker. Project %(id)s could not be "
|
||||
LOG.warning(_LW("Invalid marker. Project %(id)s could not be "
|
||||
"found.") % {'id': params.get('marker')})
|
||||
msg = _("Invalid marker. Project could not be found.")
|
||||
raise exc.HTTPBadRequest(explanation=msg)
|
||||
except exception.Forbidden:
|
||||
LOG.warn(_LW("Access denied to component %(id)s but returning "
|
||||
LOG.warning(_LW("Access denied to component %(id)s but returning "
|
||||
"'not found'") % {'id': params.get('marker')})
|
||||
msg = _("Invalid marker. Project could not be found.")
|
||||
raise exc.HTTPBadRequest(explanation=msg)
|
||||
@ -1168,7 +1168,7 @@ class Controller(object):
|
||||
return service_data
|
||||
except exception.Duplicate:
|
||||
msg = _("service with identifier %s already exists!") % service_id
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
return exc.HTTPConflict(msg)
|
||||
except exception.Invalid as e:
|
||||
msg = (_("Failed to add service metadata. "
|
||||
@ -1219,12 +1219,12 @@ class Controller(object):
|
||||
return self.db_api.service_get_all(context, filters=filters,
|
||||
**params)
|
||||
except exception.NotFound:
|
||||
LOG.warn(_LW("Invalid marker. Project %(id)s could not be "
|
||||
LOG.warning(_LW("Invalid marker. Project %(id)s could not be "
|
||||
"found.") % {'id': params.get('marker')})
|
||||
msg = _("Invalid marker. Project could not be found.")
|
||||
raise exc.HTTPBadRequest(explanation=msg)
|
||||
except exception.Forbidden:
|
||||
LOG.warn(_LW("Access denied to service %(id)s but returning "
|
||||
LOG.warning(_LW("Access denied to service %(id)s but returning "
|
||||
"'not found'") % {'id': params.get('marker')})
|
||||
msg = _("Invalid marker. Project could not be found.")
|
||||
raise exc.HTTPBadRequest(explanation=msg)
|
||||
@ -1362,7 +1362,7 @@ class Controller(object):
|
||||
return role_data
|
||||
except exception.Duplicate:
|
||||
msg = _("role with identifier %s already exists!") % role_id
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
return exc.HTTPConflict(msg)
|
||||
except exception.Invalid as e:
|
||||
msg = (_("Failed to add role metadata. "
|
||||
@ -1413,12 +1413,12 @@ class Controller(object):
|
||||
return self.db_api.role_get_all(context, filters=filters,
|
||||
**params)
|
||||
except exception.NotFound:
|
||||
LOG.warn(_LW("Invalid marker. Project %(id)s could not be "
|
||||
LOG.warning(_LW("Invalid marker. Project %(id)s could not be "
|
||||
"found.") % {'id': params.get('marker')})
|
||||
msg = _("Invalid marker. Project could not be found.")
|
||||
raise exc.HTTPBadRequest(explanation=msg)
|
||||
except exception.Forbidden:
|
||||
LOG.warn(_LW("Access denied to role %(id)s but returning "
|
||||
LOG.warning(_LW("Access denied to role %(id)s but returning "
|
||||
"'not found'") % {'id': params.get('marker')})
|
||||
msg = _("Invalid marker. Project could not be found.")
|
||||
raise exc.HTTPBadRequest(explanation=msg)
|
||||
|
@ -202,7 +202,7 @@ class Controller(object):
|
||||
return hwm_data
|
||||
except exception.Duplicate:
|
||||
msg = _("hwm with identifier %s already exists!") % id
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
return exc.HTTPConflict(msg)
|
||||
except exception.Invalid as e:
|
||||
msg = (_("Failed to add hwm metadata. "
|
||||
@ -242,7 +242,7 @@ class Controller(object):
|
||||
return hwm_data
|
||||
except exception.Duplicate:
|
||||
msg = _("hwm with identifier %s already exists!") % id
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
return exc.HTTPConflict(msg)
|
||||
except exception.Invalid as e:
|
||||
msg = (_("Failed to update hwm metadata.Got error: %s") %
|
||||
@ -300,12 +300,12 @@ class Controller(object):
|
||||
req.context, filters=filters, marker=marker, limit=limit,
|
||||
sort_key=sort_key, sort_dir=sort_dir)
|
||||
except exception.NotFound:
|
||||
LOG.warn(_LW("Invalid marker. hwm %(id)s could not be "
|
||||
LOG.warning(_LW("Invalid marker. hwm %(id)s could not be "
|
||||
"found.") % {'id': params.get('marker')})
|
||||
msg = _("Invalid marker. hwm could not be found.")
|
||||
raise exc.HTTPBadRequest(explanation=msg)
|
||||
except exception.Forbidden:
|
||||
LOG.warn(_LW("Access denied to hwm %(id)s but returning "
|
||||
LOG.warning(_LW("Access denied to hwm %(id)s but returning "
|
||||
"'not found'") % {'id': params.get('marker')})
|
||||
msg = _("Invalid marker. hwm could not be found.")
|
||||
raise exc.HTTPBadRequest(explanation=msg)
|
||||
|
@ -42,14 +42,14 @@ class Controller(object):
|
||||
self.db_api.cluster_get(req.context, cluster_id)
|
||||
except exception.NotFound:
|
||||
msg = _("Project %(id)s not found") % {'id': cluster_id}
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise webob.exc.HTTPNotFound(msg)
|
||||
except exception.Forbidden:
|
||||
# If it's private and doesn't belong to them, don't let on
|
||||
# that it exists
|
||||
msg = _LW("Access denied to cluster %(id)s but returning"
|
||||
" 'not found'") % {'id': cluster_id}
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise webob.exc.HTTPNotFound()
|
||||
|
||||
members = self.db_api.cluster_host_member_find(
|
||||
@ -70,14 +70,14 @@ class Controller(object):
|
||||
self.db_api.cluster_get(req.context, cluster_id)
|
||||
except exception.NotFound:
|
||||
msg = _("Project %(id)s not found") % {'id': cluster_id}
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise webob.exc.HTTPNotFound(msg)
|
||||
except exception.Forbidden:
|
||||
# If it's private and doesn't belong to them, don't let on
|
||||
# that it exists
|
||||
msg = _LW("Access denied to cluster %(id)s but returning"
|
||||
" 'not found'") % {'id': cluster_id}
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise webob.exc.HTTPNotFound()
|
||||
|
||||
# Make sure the host exists
|
||||
@ -85,14 +85,14 @@ class Controller(object):
|
||||
self.db_api.host_get(req.context, host_id)
|
||||
except exception.NotFound:
|
||||
msg = _("Host %(id)s not found") % {'id': host_id}
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise webob.exc.HTTPNotFound(msg)
|
||||
except exception.Forbidden:
|
||||
# If it's private and doesn't belong to them, don't let on
|
||||
# that it exists
|
||||
msg = _LW("Access denied to host %(id)s but returning"
|
||||
" 'not found'") % {'id': host_id}
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise webob.exc.HTTPNotFound()
|
||||
|
||||
# Look up an existing membership...
|
||||
@ -123,14 +123,14 @@ class Controller(object):
|
||||
self.db_api.cluster_get(req.context, cluster_id)
|
||||
except exception.NotFound:
|
||||
msg = _("Project %(id)s not found") % {'id': cluster_id}
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise webob.exc.HTTPNotFound(msg)
|
||||
except exception.Forbidden:
|
||||
# If it's private and doesn't belong to them, don't let on
|
||||
# that it exists
|
||||
msg = _LW("Access denied to cluster %(id)s but returning"
|
||||
" 'not found'") % {'id': cluster_id}
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise webob.exc.HTTPNotFound()
|
||||
|
||||
# Make sure the host exists
|
||||
@ -138,14 +138,14 @@ class Controller(object):
|
||||
self.db_api.host_get(req.context, host_id)
|
||||
except exception.NotFound:
|
||||
msg = _("Host %(id)s not found") % {'id': host_id}
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise webob.exc.HTTPNotFound(msg)
|
||||
except exception.Forbidden:
|
||||
# If it's private and doesn't belong to them, don't let on
|
||||
# that it exists
|
||||
msg = _LW("Access denied to host %(id)s but returning"
|
||||
" 'not found'") % {'id': host_id}
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise webob.exc.HTTPNotFound()
|
||||
|
||||
# Look up an existing membership
|
||||
@ -185,7 +185,7 @@ class Controller(object):
|
||||
req.context, host_id=host_id)
|
||||
except exception.NotFound:
|
||||
msg = _LW("Host %(id)s not found") % {'id': host_id}
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
msg = _("Membership could not be found.")
|
||||
raise webob.exc.HTTPBadRequest(explanation=msg)
|
||||
|
||||
|
@ -66,12 +66,12 @@ class Controller(object):
|
||||
filters=filters,
|
||||
**params)
|
||||
except exception.NotFound:
|
||||
LOG.warn(_LW("Invalid marker. Network %(id)s could not be "
|
||||
LOG.warning(_LW("Invalid marker. Network %(id)s could not be "
|
||||
"found.") % {'id': params.get('marker')})
|
||||
msg = _("Invalid marker. Network could not be found.")
|
||||
raise exc.HTTPBadRequest(explanation=msg)
|
||||
except exception.Forbidden:
|
||||
LOG.warn(_LW("Access denied to network %(id)s but returning "
|
||||
LOG.warning(_LW("Access denied to network %(id)s but returning "
|
||||
"'not found'") % {'id': params.get('marker')})
|
||||
msg = _("Invalid marker. Network could not be found.")
|
||||
raise exc.HTTPBadRequest(explanation=msg)
|
||||
@ -274,7 +274,7 @@ class Controller(object):
|
||||
return network_data
|
||||
except exception.Duplicate:
|
||||
msg = _("node with identifier %s already exists!") % network_id
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
return exc.HTTPConflict(msg)
|
||||
except exception.Invalid as e:
|
||||
msg = (_("Failed to add node metadata. "
|
||||
|
@ -211,7 +211,7 @@ class Controller(object):
|
||||
return neutron_backend_data
|
||||
except exception.Duplicate:
|
||||
msg = _("neutron_backend with identifier %s already exists!") % id
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
return exc.HTTPConflict(msg)
|
||||
except exception.Invalid as e:
|
||||
msg = (_("Failed to add neutron_backend metadata. "
|
||||
@ -254,7 +254,7 @@ class Controller(object):
|
||||
return neutron_backend_data
|
||||
except exception.Duplicate:
|
||||
msg = _("neutron_backend with identifier %s already exists!") % id
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
return exc.HTTPConflict(msg)
|
||||
except exception.Invalid as e:
|
||||
msg = (_("Failed to update neutron_backend "
|
||||
@ -308,12 +308,12 @@ class Controller(object):
|
||||
return self.db_api.neutron_backend_list(context, filters=filters,
|
||||
**params)
|
||||
except exception.NotFound:
|
||||
LOG.warn(_LW("Invalid marker. neutron_backend %(id)s could not be "
|
||||
LOG.warning(_LW("Invalid marker. neutron_backend %(id)s not"
|
||||
"found.") % {'id': params.get('marker')})
|
||||
msg = _("Invalid marker. neutron_backend could not be found.")
|
||||
raise exc.HTTPBadRequest(explanation=msg)
|
||||
except exception.Forbidden:
|
||||
LOG.warn(_LW("Access denied to neutron_backend "
|
||||
LOG.warning(_LW("Access denied to neutron_backend "
|
||||
"%(id)s but returning "
|
||||
"'not found'") % {'id': params.get('marker')})
|
||||
msg = _("Invalid marker. neutron_backend could not be found.")
|
||||
|
@ -207,6 +207,7 @@ class Controller(object):
|
||||
if id and not utils.is_uuid_like(id):
|
||||
msg = _LI("Rejecting template creation request for "
|
||||
"invalid template "
|
||||
|
||||
"id '%(bad_id)s'") % {'bad_id': id}
|
||||
LOG.info(msg)
|
||||
msg = _("Invalid template id format")
|
||||
@ -223,7 +224,7 @@ class Controller(object):
|
||||
return template_data
|
||||
except exception.Duplicate:
|
||||
msg = _("template with identifier %s already exists!") % id
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
return exc.HTTPConflict(msg)
|
||||
except exception.Invalid as e:
|
||||
msg = (_("Failed to add template metadata. "
|
||||
@ -266,7 +267,7 @@ class Controller(object):
|
||||
except exception.Duplicate:
|
||||
msg = _("template with identifier %s already exists!") % \
|
||||
template_id
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
return exc.HTTPConflict(msg)
|
||||
except exception.Invalid as e:
|
||||
msg = (_("Failed to update template metadata. "
|
||||
@ -327,12 +328,12 @@ class Controller(object):
|
||||
sort_key=sort_key,
|
||||
sort_dir=sort_dir)
|
||||
except exception.NotFound:
|
||||
LOG.warn(_LW("Invalid marker. template %(id)s could not be "
|
||||
LOG.warning(_LW("Invalid marker. template %(id)s could not be "
|
||||
"found.") % {'id': params.get('marker')})
|
||||
msg = _("Invalid marker. template could not be found.")
|
||||
raise exc.HTTPBadRequest(explanation=msg)
|
||||
except exception.Forbidden:
|
||||
LOG.warn(_LW("Access denied to template %(id)s but returning "
|
||||
LOG.warning(_LW("Access denied to template %(id)s but returning "
|
||||
"'not found'") % {'id': params.get('marker')})
|
||||
msg = _("Invalid marker. template could not be found.")
|
||||
raise exc.HTTPBadRequest(explanation=msg)
|
||||
@ -421,7 +422,7 @@ class Controller(object):
|
||||
return template_data
|
||||
except exception.Duplicate:
|
||||
msg = _("node with identifier %s already exists!") % id
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
return exc.HTTPConflict(msg)
|
||||
except exception.Invalid as e:
|
||||
msg = (_("Failed to add node metadata. "
|
||||
@ -468,7 +469,7 @@ class Controller(object):
|
||||
except exception.Duplicate:
|
||||
msg = _("template with identifier %s already exists!") % \
|
||||
template_id
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
return exc.HTTPConflict(msg)
|
||||
except exception.Invalid as e:
|
||||
msg = (_("Failed to update template metadata. "
|
||||
@ -533,12 +534,12 @@ class Controller(object):
|
||||
sort_key=sort_key,
|
||||
sort_dir=sort_dir)
|
||||
except exception.NotFound:
|
||||
LOG.warn(_LW("Invalid marker. template %(id)s could not be "
|
||||
LOG.warning(_LW("Invalid marker. template %(id)s could not be "
|
||||
"found.") % {'id': params.get('marker')})
|
||||
msg = _("Invalid marker. template could not be found.")
|
||||
raise exc.HTTPBadRequest(explanation=msg)
|
||||
except exception.Forbidden:
|
||||
LOG.warn(_LW("Access denied to template %(id)s but returning "
|
||||
LOG.warning(_LW("Access denied to template %(id)s but returning "
|
||||
"'not found'") % {'id': params.get('marker')})
|
||||
msg = _("Invalid marker. template could not be found.")
|
||||
raise exc.HTTPBadRequest(explanation=msg)
|
||||
|
@ -63,12 +63,12 @@ class Controller(object):
|
||||
filters=filters,
|
||||
**params)
|
||||
except exception.NotFound:
|
||||
LOG.warn(_LW("Invalid marker. template config %(id)s could not be "
|
||||
LOG.warning(_LW("Invalid marker.template config %(id)s not"
|
||||
"found.") % {'id': params.get('marker')})
|
||||
msg = _("Invalid marker. template config could not be found.")
|
||||
raise exc.HTTPBadRequest(explanation=msg)
|
||||
except exception.Forbidden:
|
||||
LOG.warn(_LW("Access denied to template config %(id)s but "
|
||||
LOG.warning(_LW("Access denied to template config %(id)s but "
|
||||
"returning 'not found'") %
|
||||
{'id': params.get('marker')})
|
||||
msg = _("Invalid marker. template config could not be found.")
|
||||
@ -253,7 +253,7 @@ class Controller(object):
|
||||
except exception.Duplicate:
|
||||
msg = (_("template function with identifier %s already exists!") %
|
||||
template_config_data)
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
return exc.HTTPConflict(msg)
|
||||
except exception.Invalid as e:
|
||||
msg = (_("Failed to add template function metadata. "
|
||||
|
@ -61,12 +61,12 @@ class Controller(object):
|
||||
filters=filters,
|
||||
**params)
|
||||
except exception.NotFound:
|
||||
LOG.warn(_LW("Invalid marker. template function %(id)s could not "
|
||||
"be found.") % {'id': params.get('marker')})
|
||||
LOG.warning(_LW("Invalid marker. template function %(id)s not"
|
||||
"found.") % {'id': params.get('marker')})
|
||||
msg = _("Invalid marker. template function could not be found.")
|
||||
raise exc.HTTPBadRequest(explanation=msg)
|
||||
except exception.Forbidden:
|
||||
LOG.warn(_LW("Access denied to template function %(id)s but "
|
||||
LOG.warning(_LW("Access denied to template function %(id)s but "
|
||||
"returning 'not found'") %
|
||||
{'id': params.get('marker')})
|
||||
msg = _("Invalid marker. template function could not be found.")
|
||||
@ -264,7 +264,7 @@ class Controller(object):
|
||||
except exception.Duplicate:
|
||||
msg = (_("template function with identifier %s already exists!") %
|
||||
template_func_data)
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
return exc.HTTPConflict(msg)
|
||||
except exception.Invalid as e:
|
||||
msg = (_("Failed to add template function metadata. "
|
||||
|
@ -60,12 +60,12 @@ class Controller(object):
|
||||
filters=filters,
|
||||
**params)
|
||||
except exception.NotFound:
|
||||
LOG.warn(_LW("Invalid marker. template function %(id)s could not "
|
||||
"be found.") % {'id': params.get('marker')})
|
||||
LOG.warning(_LW("Invalid marker.template function %(id)s not "
|
||||
"found.") % {'id': params.get('marker')})
|
||||
msg = _("Invalid marker. template function could not be found.")
|
||||
raise exc.HTTPBadRequest(explanation=msg)
|
||||
except exception.Forbidden:
|
||||
LOG.warn(_LW("Access denied to template func %(id)s but"
|
||||
LOG.warning(_LW("Access denied to template func %(id)s but"
|
||||
"returning 'not found'") %
|
||||
{'id': params.get('marker')})
|
||||
msg = _("Invalid marker. template function could not be found.")
|
||||
|
@ -187,12 +187,12 @@ class Controller(object):
|
||||
filters=filters,
|
||||
**params)
|
||||
except exception.NotFound:
|
||||
LOG.warn(_LW("Invalid marker patch history %(id)s could not be "
|
||||
LOG.warning(_LW("Invalid marker patch history %(id)s could not be "
|
||||
"found.") % {'id': params.get('marker')})
|
||||
msg = _("Invalid marker. Host could not be found.")
|
||||
raise exc.HTTPBadRequest(explanation=msg)
|
||||
except exception.Forbidden:
|
||||
LOG.warn(_LW("Access denied to patch history %(id)s but returning "
|
||||
LOG.warning(_LW("Access denied patch history %(id)s but returned "
|
||||
"'not found'") % {'id': params.get('marker')})
|
||||
msg = _("Invalid marker. Host could not be found.")
|
||||
raise exc.HTTPBadRequest(explanation=msg)
|
||||
@ -234,7 +234,7 @@ class Controller(object):
|
||||
except exception.Duplicate:
|
||||
msg = (_("version patch with identifier %s"
|
||||
" already exists!") % version_patch_id)
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
return exc.HTTPConflict(msg)
|
||||
except exception.Invalid as e:
|
||||
msg = (_("Failed to add version patch metadata. "
|
||||
@ -386,7 +386,7 @@ class Controller(object):
|
||||
except exception.Duplicate:
|
||||
msg = (_("patch history with identifier %s already exists!") %
|
||||
patch_history_meta['patch_name'])
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
return exc.HTTPConflict(msg)
|
||||
except exception.Invalid as e:
|
||||
msg = (_("Failed to add patch history metadata. "
|
||||
|
@ -64,12 +64,12 @@ class Controller(object):
|
||||
filters=filters,
|
||||
**params)
|
||||
except exception.NotFound:
|
||||
LOG.warn(_LW("Invalid marker. version %(id)s could not be "
|
||||
LOG.warning(_LW("Invalid marker. version %(id)s could not be "
|
||||
"found.") % {'id': params.get('marker')})
|
||||
msg = _("Invalid marker. version could not be found.")
|
||||
raise exc.HTTPBadRequest(explanation=msg)
|
||||
except exception.Forbidden:
|
||||
LOG.warn(_LW("Access denied to version %(id)s but returning "
|
||||
LOG.warning(_LW("Access denied to version %(id)s but returning "
|
||||
"'not found'") % {'id': params.get('marker')})
|
||||
msg = _("Invalid marker. version could not be found.")
|
||||
raise exc.HTTPBadRequest(explanation=msg)
|
||||
@ -246,7 +246,7 @@ class Controller(object):
|
||||
except exception.Duplicate:
|
||||
msg = (_("version with identifier %s already exists!") %
|
||||
version_data['name'])
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
return exc.HTTPConflict(msg)
|
||||
except exception.Invalid as e:
|
||||
msg = (_("Failed to add version metadata. "
|
||||
|
@ -1,7 +1,7 @@
|
||||
# The order of packages is significant, because pip processes them in the order
|
||||
# of appearance. Changing the order has an impact on the overall integration
|
||||
# process, which may cause wedges in the gate later.
|
||||
pbr>=0.6,!=0.7,<1.0
|
||||
#pbr>=0.6,!=0.7,<1.0
|
||||
Babel>=1.3
|
||||
argparse
|
||||
PrettyTable>=0.7,<0.8
|
||||
@ -9,6 +9,6 @@ python-keystoneclient>=1.0.0
|
||||
pyOpenSSL>=0.11
|
||||
requests>=2.2.0,!=2.4.0
|
||||
warlock>=1.0.1,<2
|
||||
six>=1.7.0
|
||||
#six>=1.7.0
|
||||
oslo.utils>=1.2.0 # Apache-2.0
|
||||
oslo.i18n>=1.3.0 # Apache-2.0
|
||||
|
@ -245,7 +245,7 @@ class Enforcer(object):
|
||||
try:
|
||||
path = self._get_policy_path(path)
|
||||
except cfg.ConfigFilesNotFoundError:
|
||||
LOG.warn(_LW("Can not find policy directories %s"), path)
|
||||
LOG.warning(_LW("Can not find policy directories %s"), path)
|
||||
continue
|
||||
self._walk_through_policy_directory(path,
|
||||
self._load_policy_file,
|
||||
|
@ -49,7 +49,7 @@ def _get_enforcer():
|
||||
LOG.debug("adding enforcer for service: %s" % service)
|
||||
_ENFORCER[service] = enforcer
|
||||
else:
|
||||
LOG.warn("policy file for service: %s not found at %s" %
|
||||
LOG.warning("policy file for service: %s not found at %s" %
|
||||
(service, enforcer.policy_path))
|
||||
return _ENFORCER
|
||||
|
||||
|
@ -12,7 +12,6 @@ Source0: https://pypi.python.org/packages/source/i/ironic-discoverd/ironic-disco
|
||||
Source1: openstack-ironic-discoverd.service
|
||||
Source2: openstack-ironic-discoverd-dnsmasq.service
|
||||
Source3: dnsmasq.conf
|
||||
Patch0: 0001-default-database-location.patch
|
||||
|
||||
BuildArch: noarch
|
||||
BuildRequires: python-setuptools
|
||||
@ -75,7 +74,7 @@ This package contains Python modules and documentation.
|
||||
%files -n python-ironic-discoverd
|
||||
%doc README.rst CONTRIBUTING.rst
|
||||
%license LICENSE
|
||||
%{python_sitelib}/ironic_discoverd*
|
||||
%{python2_sitelib}/ironic_discoverd*
|
||||
|
||||
|
||||
%description
|
||||
@ -141,6 +140,5 @@ This package contains main executable and service files.
|
||||
* Thu Oct 16 2014 Dmitry Tantsur <dtantsur@redhat.com> - 0.2.1-1
|
||||
- Upstream bugfix release
|
||||
|
||||
* Wed Oct 8 2014 Dmitry Tantsur <dtantsur@redhat.com> - 0.2.0-1
|
||||
* Wed Oct 8 2014 Dmitry Tantsur <dtantsur@redhat.com> - 0.2.0-1- Initial package build
|
||||
- Initial package build
|
||||
|
||||
|
@ -51,9 +51,9 @@ def get_network_from_name(name, compute_networks_client):
|
||||
else:
|
||||
msg = "Network with name: %s not found" % name
|
||||
if caller:
|
||||
LOG.warn('(%s) %s' % (caller, msg))
|
||||
LOG.warning('(%s) %s' % (caller, msg))
|
||||
else:
|
||||
LOG.warn(msg)
|
||||
LOG.warning(msg)
|
||||
raise lib_exc.NotFound()
|
||||
# To be consistent with network isolation, add name is only
|
||||
# label is available
|
||||
@ -125,6 +125,6 @@ def set_networks_kwarg(network, kwargs=None):
|
||||
if 'id' in network.keys():
|
||||
params.update({"networks": [{'uuid': network['id']}]})
|
||||
else:
|
||||
LOG.warn('The provided network dict: %s was invalid and did not '
|
||||
LOG.warning('provided network dict: %s was invalid, did not '
|
||||
' contain an id' % network)
|
||||
return params
|
||||
|
@ -348,7 +348,7 @@ class IsolatedCreds(cred_provider.CredentialProvider):
|
||||
try:
|
||||
net_client.delete_router(router_id)
|
||||
except lib_exc.NotFound:
|
||||
LOG.warn('router with name: %s not found for delete' %
|
||||
LOG.warning('router with name: %s not found for delete' %
|
||||
router_name)
|
||||
|
||||
def _clear_isolated_subnet(self, subnet_id, subnet_name):
|
||||
@ -356,7 +356,7 @@ class IsolatedCreds(cred_provider.CredentialProvider):
|
||||
try:
|
||||
net_client.delete_subnet(subnet_id)
|
||||
except lib_exc.NotFound:
|
||||
LOG.warn('subnet with name: %s not found for delete' %
|
||||
LOG.warning('subnet with name: %s not found for delete' %
|
||||
subnet_name)
|
||||
|
||||
def _clear_isolated_network(self, network_id, network_name):
|
||||
@ -364,7 +364,7 @@ class IsolatedCreds(cred_provider.CredentialProvider):
|
||||
try:
|
||||
net_client.delete_network(network_id)
|
||||
except lib_exc.NotFound:
|
||||
LOG.warn('network with name: %s not found for delete' %
|
||||
LOG.warning('network with name: %s not found for delete' %
|
||||
network_name)
|
||||
|
||||
def _cleanup_default_secgroup(self, tenant):
|
||||
@ -376,7 +376,7 @@ class IsolatedCreds(cred_provider.CredentialProvider):
|
||||
try:
|
||||
net_client.delete_security_group(secgroup['id'])
|
||||
except lib_exc.NotFound:
|
||||
LOG.warn('Security group %s, id %s not found for clean-up' %
|
||||
LOG.warning('Security group %s, id %s not found for clean-up' %
|
||||
(secgroup['name'], secgroup['id']))
|
||||
|
||||
def _clear_isolated_net_resources(self):
|
||||
@ -396,7 +396,7 @@ class IsolatedCreds(cred_provider.CredentialProvider):
|
||||
net_client.remove_router_interface_with_subnet_id(
|
||||
creds.router['id'], creds.subnet['id'])
|
||||
except lib_exc.NotFound:
|
||||
LOG.warn('router with name: %s not found for delete' %
|
||||
LOG.warning('router with name: %s not found for delete' %
|
||||
creds.router['name'])
|
||||
self._clear_isolated_router(creds.router['id'],
|
||||
creds.router['name'])
|
||||
@ -417,14 +417,14 @@ class IsolatedCreds(cred_provider.CredentialProvider):
|
||||
try:
|
||||
self.creds_client.delete_user(creds.user_id)
|
||||
except lib_exc.NotFound:
|
||||
LOG.warn("user with name: %s not found for delete" %
|
||||
LOG.warning("user with name: %s not found for delete" %
|
||||
creds.username)
|
||||
try:
|
||||
if CONF.service_available.neutron:
|
||||
self._cleanup_default_secgroup(creds.tenant_id)
|
||||
self.creds_client.delete_project(creds.tenant_id)
|
||||
except lib_exc.NotFound:
|
||||
LOG.warn("tenant with name: %s not found for delete" %
|
||||
LOG.warning("tenant with name: %s not found for delete" %
|
||||
creds.tenant_name)
|
||||
self.isolated_creds = {}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user