Merge "Remove unused methods"

This commit is contained in:
Jenkins 2014-02-26 03:10:16 +00:00 committed by Gerrit Code Review
commit a891e044c8
6 changed files with 0 additions and 65 deletions

View File

@ -187,18 +187,6 @@ class _BaseMessage(object):
self.routing_path = routing_path + self.our_path_part
self.hop_count += 1
def _at_max_hop_count(self, do_raise=True):
"""Check if we're at the max hop count. If we are and do_raise is
True, raise CellMaxHopCountReached. If we are at the max and
do_raise is False... return True, else False.
"""
if self.hop_count >= self.max_hop_count:
if do_raise:
raise exception.CellMaxHopCountReached(
hop_count=self.hop_count)
return True
return False
def _process_locally(self):
"""Its been determined that we should process this message in this
cell. Go through the MessageRunner to call the appropriate

View File

@ -74,12 +74,6 @@ class NbdMount(api.Mount):
return None
return os.path.join('/dev', device)
def _read_pid_file(self, pidfile):
# This is for unit test convenience
with open(pidfile) as f:
pid = int(f.readline())
return pid
@utils.synchronized('nbd-allocation-lock')
def _inner_get_dev(self):
device = self._allocate_nbd()

View File

@ -40,14 +40,6 @@ class ImageCache(object):
self._pathutils = utilsfactory.get_pathutils()
self._vhdutils = utilsfactory.get_vhdutils()
def _validate_vhd_image(self, vhd_path):
try:
self._vhdutils.validate_vhd(vhd_path)
except Exception as ex:
LOG.exception(ex)
raise vmutils.HyperVException(_('The image is not a valid VHD: %s')
% vhd_path)
def _get_root_vhd_size_gb(self, instance):
try:
# In case of resizes we need the old root disk size

View File

@ -476,22 +476,6 @@ class VMUtils(object):
def _get_wmi_obj(self, path):
return wmi.WMI(moniker=path.replace('\\', '/'))
def _clone_wmi_obj(self, wmi_class, wmi_obj):
"""Clone a WMI object."""
cl = getattr(self._conn, wmi_class) # get the class
newinst = cl.new()
#Copy the properties from the original.
for prop in wmi_obj._properties:
if prop == "VirtualSystemIdentifiers":
strguid = []
strguid.append(str(uuid.uuid4()))
newinst.Properties_.Item(prop).Value = strguid
else:
prop_value = wmi_obj.Properties_.Item(prop).Value
newinst.Properties_.Item(prop).Value = prop_value
return newinst
def _add_virt_resource(self, res_setting_data, vm_path):
"""Adds a new resource to the VM."""
vs_man_svc = self._conn.Msvm_VirtualSystemManagementService()[0]

View File

@ -257,10 +257,6 @@ class NWFilterFirewall(base_firewall.FirewallDriver):
LOG.debug(_('The nwfilter(%s) is not found.'),
instance_filter_name, instance=instance)
def _define_filters(self, filter_name, filter_children):
self._define_filter(self._filter_container(filter_name,
filter_children))
@staticmethod
def _instance_filter_name(instance, nic_id=None):
if not nic_id:

View File

@ -302,25 +302,6 @@ def mountpoint_to_number(mountpoint):
return -1
def _get_volume_id(path_or_id):
"""Retrieve the volume id from device_path."""
# If we have the ID and not a path, just return it.
if isinstance(path_or_id, int):
return path_or_id
# n must contain at least the volume_id
# :volume- is for remote volumes
# -volume- is for local volumes
# see compute/manager->setup_compute_volume
volume_id = path_or_id[path_or_id.find(':volume-') + 1:]
if volume_id == path_or_id:
volume_id = path_or_id[path_or_id.find('-volume--') + 1:]
volume_id = volume_id.replace('volume--', '')
else:
volume_id = volume_id.replace('volume-', '')
volume_id = volume_id[0:volume_id.find('-')]
return int(volume_id)
def _get_target_host(iscsi_string):
"""Retrieve target host."""
if iscsi_string: