From patchwork Mon Dec 27 23:00:48 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Goldish X-Patchwork-Id: 435351 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id oBRN0Xjc026392 for ; Mon, 27 Dec 2010 23:00:54 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752392Ab0L0XAb (ORCPT ); Mon, 27 Dec 2010 18:00:31 -0500 Received: from mx1.redhat.com ([209.132.183.28]:55836 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752193Ab0L0XAa (ORCPT ); Mon, 27 Dec 2010 18:00:30 -0500 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id oBRN0U4b026707 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 27 Dec 2010 18:00:30 -0500 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id oBRN0T0H018214; Mon, 27 Dec 2010 18:00:29 -0500 Received: from moof.tlv.redhat.com (dhcp-1-185.tlv.redhat.com [10.35.1.185]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id oBRN0ORN023933; Mon, 27 Dec 2010 18:00:28 -0500 From: Michael Goldish To: autotest@test.kernel.org, kvm@vger.kernel.org Cc: 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> In-Reply-To: <1293490848-28376-1-git-send-email-mgoldish@redhat.com> References: <1293490848-28376-1-git-send-email-mgoldish@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Mon, 27 Dec 2010 23:00:54 +0000 (UTC) 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.