Remove unused methods

o nova/cells/messaging.py
   - def _at_max_hop_count(self, do_raise=True):

     This method was added in the following commit.

        commit f9a868e86c
        Author: Chris Behrens <cbehrens@codestud.com>
        Date:   Fri Apr 13 05:54:48 2012 +0000

            Cells: Add the main code.

     But there is no evidence that was used.

 o nova/virt/disk/mount/nbd.py
   - def _read_pid_file(self, pidfile):

     This method was added in the following commit.

        commit e4377fdb0e
        Author: Michael Still <michael.still@canonical.com>
        Date:   Wed Dec 12 17:13:53 2012 +1100

            Stop nbd leaks, remove pid race.

     But there is no evidence that was used.

 o nova/virt/hyperv/imagecache.py
   - def _validate_vhd_image(self, vhd_path):

     This method was removed in the following commit.

        commit 689e9e3e3d
        Author: Alessandro Pilotti <ap@pilotti.it>
        Date:   Mon Mar 4 11:34:42 2013 +0200

            Fixes disk size issue during image boot on Hyper-V

 o nova/virt/hyperv/vmutils.py
   - def _clone_wmi_obj(self, wmi_class, wmi_obj):

     This method was removed in the following commit.

        commit d1a2e10869
        Author: Alessandro Pilotti <apilotti@cloudbasesolutions.com>
        Date:   Tue Jul 30 03:58:11 2013 +0300

            Improves Hyper-V vmutils module for subclassing

 o nova/virt/libvirt/firewall.py
   - def _define_filters(self, filter_name, filter_children):

     This method was removed in the following commit.

        commit b4fae4821f
        Author: Yaguang Tang <heut2008@gmail.com>
        Date:   Tue Feb 14 10:43:39 2012 +0800

            remove unused nwfilter methods and tests.

 o nova/virt/xenapi/volume_utils.py
   - def _get_volume_id(path_or_id):

     This method was removed in the following commit.

        commit 503d572954
        Author: Armando Migliaccio <amigliaccio@internap.com>
        Date:   Fri Dec 7 21:06:43 2012 +0000

           Fixes KeyError: 'sr_uuid' when booting from volume on xenapi

Change-Id: I216f7c4ff3546c41e1fb0813a71a6c7ff9498584
This commit is contained in:
KIYOHIRO ADACHI 2014-02-12 16:51:07 +09:00
parent c33594baa9
commit 4e9796712c
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

@ -41,14 +41,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: