Return-Path: X-Original-To: apmail-cloudstack-commits-archive@www.apache.org Delivered-To: apmail-cloudstack-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E237B10D3D for ; Mon, 30 Sep 2013 09:53:17 +0000 (UTC) Received: (qmail 71006 invoked by uid 500); 30 Sep 2013 09:51:46 -0000 Delivered-To: apmail-cloudstack-commits-archive@cloudstack.apache.org Received: (qmail 70954 invoked by uid 500); 30 Sep 2013 09:51:39 -0000 Mailing-List: contact commits-help@cloudstack.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cloudstack.apache.org Delivered-To: mailing list commits@cloudstack.apache.org Received: (qmail 70211 invoked by uid 99); 30 Sep 2013 09:50:42 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 30 Sep 2013 09:50:42 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id C909190DC0A; Mon, 30 Sep 2013 09:50:41 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: swamy@apache.org To: commits@cloudstack.apache.org Message-Id: <0c7d201abfc84f34b8b662d9774c5e63@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: git commit: updated refs/heads/master to b7e00d3 Date: Mon, 30 Sep 2013 09:50:41 +0000 (UTC) Updated Branches: refs/heads/master 55ef4b8c3 -> b7e00d370 CLOUDSTACK: 4706 - Adding missing method get_region in common.py Signed-off-by: venkataswamybabu budumuru (cherry picked from commit 503fe75dc93be209f0382ddf9c0b548009342565) Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/b7e00d37 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/b7e00d37 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/b7e00d37 Branch: refs/heads/master Commit: b7e00d37006aef9d5c832fa43f7f3ddcdff7eadb Parents: 55ef4b8 Author: Gaurav Aradhye Authored: Wed Sep 18 20:50:37 2013 -0400 Committer: venkataswamybabu budumuru Committed: Mon Sep 30 15:19:58 2013 +0530 ---------------------------------------------------------------------- tools/marvin/marvin/integration/lib/common.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/b7e00d37/tools/marvin/marvin/integration/lib/common.py ---------------------------------------------------------------------- diff --git a/tools/marvin/marvin/integration/lib/common.py b/tools/marvin/marvin/integration/lib/common.py index e895885..164ef20 100644 --- a/tools/marvin/marvin/integration/lib/common.py +++ b/tools/marvin/marvin/integration/lib/common.py @@ -94,6 +94,22 @@ def add_netscaler(apiclient, zoneid, NSservice): return netscaler +def get_region(apiclient, services=None): + "Returns a default region" + + cmd = listRegions.listRegionsCmd() + if services: + if "regionid" in services: + cmd.id = services["regionid"] + + regions = apiclient.listRegions(cmd) + + if isinstance(regions, list): + assert len(regions) > 0 + return regions[0] + else: + raise Exception("Failed to find specified region.") + def get_domain(apiclient, services=None): "Returns a default domain"