from neutron.common import exceptions
import neutron.common.utils as utils
from neutron.openstack.common import excutils
+from neutron.openstack.common.gettextutils import _LE, _LI, _LW
from neutron.openstack.common import importutils
from neutron.openstack.common import log as logging
from neutron.openstack.common import policy
for pol in policies.keys():
if any([pol.startswith(depr_pol) for depr_pol in
DEPRECATED_POLICY_MAP.keys()]):
- LOG.warn(_("Found deprecated policy rule:%s. Please consider "
- "upgrading your policy configuration file"), pol)
+ LOG.warn(_LW("Found deprecated policy rule:%s. Please consider "
+ "upgrading your policy configuration file"), pol)
pol_name, action = pol.rsplit(':', 1)
try:
new_actions = DEPRECATED_ACTION_MAP[action]
new_policies)]:
if actual_policy not in policies:
# New policy, same rule
- LOG.info(_("Inserting policy:%(new_policy)s in place "
- "of deprecated policy:%(old_policy)s"),
+ LOG.info(_LI("Inserting policy:%(new_policy)s in "
+ "place of deprecated "
+ "policy:%(old_policy)s"),
{'new_policy': actual_policy,
'old_policy': pol})
policies[actual_policy] = policies[pol]
# Remove old-style policy
del policies[pol]
except KeyError:
- LOG.error(_("Backward compatibility unavailable for "
- "deprecated policy %s. The policy will "
- "not be enforced"), pol)
+ LOG.error(_LE("Backward compatibility unavailable for "
+ "deprecated policy %s. The policy will "
+ "not be enforced"), pol)
policy.set_rules(policies)
validate = attr['validate']
key = filter(lambda k: k.startswith('type:dict'), validate.keys())
if not key:
- LOG.warn(_("Unable to find data type descriptor for attribute %s"),
+ LOG.warn(_LW("Unable to find data type descriptor for attribute %s"),
attr_name)
return
data = validate[key[0]]
target[self.target_field] = data[parent_field]
except Exception:
with excutils.save_and_reraise_exception():
- LOG.exception(_('Policy check error while calling %s!'), f)
+ LOG.exception(_LE('Policy check error while calling %s!'),
+ f)
match = self.match % target
if self.kind in creds:
return match == unicode(creds[self.kind])