From: Michael Goldish Subject: [KVM-AUTOTEST PATCH 4/4] KVM test: remove get_sub_dict_names() and get_sub_dict() Date: Tue, 28 Dec 2010 01:00:48 +0200 Message-ID: <1293490848-28376-4-git-send-email-mgoldish@redhat.com> References: <1293490848-28376-1-git-send-email-mgoldish@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: autotest@test.kernel.org, kvm@vger.kernel.org Return-path: In-Reply-To: <1293490848-28376-1-git-send-email-mgoldish@redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: autotest-bounces@test.kernel.org Errors-To: autotest-bounces@test.kernel.org List-Id: kvm.vger.kernel.org Signed-off-by: Michael Goldish --- client/tests/kvm/kvm_utils.py | 35 ----------------------------------- 1 files changed, 0 insertions(+), 35 deletions(-) diff --git a/client/tests/kvm/kvm_utils.py b/client/tests/kvm/kvm_utils.py index 1e32e30..2e4ba92 100644 --- a/client/tests/kvm/kvm_utils.py +++ b/client/tests/kvm/kvm_utils.py @@ -62,41 +62,6 @@ def load_env(filename, version): return default -def get_sub_dict(dict, name): - """ - Return a "sub-dict" corresponding to a specific object. - - Operate on a copy of dict: for each key that ends with the suffix - "_" + name, strip the suffix from the key, and set the value of - the stripped key to that of the key. Return the resulting dict. - - @param name: Suffix of the key we want to set the value. - """ - suffix = "_" + name - new_dict = dict.copy() - for key in dict.keys(): - if key.endswith(suffix): - new_key = key.split(suffix)[0] - new_dict[new_key] = dict[key] - return new_dict - - -def get_sub_dict_names(dict, keyword): - """ - Return a list of "sub-dict" names that may be extracted with get_sub_dict. - - This function may be modified to change the behavior of all functions that - deal with multiple objects defined in dicts (e.g. VMs, images, NICs). - - @param keyword: A key in dict (e.g. "vms", "images", "nics"). - """ - names = dict.get(keyword) - if names: - return names.split() - else: - return [] - - class Params(UserDict.IterableUserDict): """ A dict-like object passed to every test. -- 1.7.3.4