From tashi-commits-return-492-apmail-incubator-tashi-commits-archive=incubator.apache.org@incubator.apache.org Fri Mar 23 22:56:59 2012 Return-Path: X-Original-To: apmail-incubator-tashi-commits-archive@minotaur.apache.org Delivered-To: apmail-incubator-tashi-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id BB2B99F03 for ; Fri, 23 Mar 2012 22:56:59 +0000 (UTC) Received: (qmail 71872 invoked by uid 500); 23 Mar 2012 22:56:59 -0000 Delivered-To: apmail-incubator-tashi-commits-archive@incubator.apache.org Received: (qmail 71850 invoked by uid 500); 23 Mar 2012 22:56:59 -0000 Mailing-List: contact tashi-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: tashi-dev@incubator.apache.org Delivered-To: mailing list tashi-commits@incubator.apache.org Received: (qmail 71841 invoked by uid 99); 23 Mar 2012 22:56:59 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Mar 2012 22:56:59 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED,T_FRT_STOCK2 X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 Mar 2012 22:56:58 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 2A6DE23889FA; Fri, 23 Mar 2012 22:56:38 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1304645 - in /incubator/tashi/trunk: etc/TashiDefaults.cfg src/tashi/client/tashi-client.py src/tashi/clustermanager/clustermanager.py src/tashi/clustermanager/clustermanagerservice.py Date: Fri, 23 Mar 2012 22:56:37 -0000 To: tashi-commits@incubator.apache.org From: stroucki@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120323225638.2A6DE23889FA@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: stroucki Date: Fri Mar 23 22:56:37 2012 New Revision: 1304645 URL: http://svn.apache.org/viewvc?rev=1304645&view=rev Log: Support configurable default network. Fixes TASHI-16. Modified: incubator/tashi/trunk/etc/TashiDefaults.cfg incubator/tashi/trunk/src/tashi/client/tashi-client.py incubator/tashi/trunk/src/tashi/clustermanager/clustermanager.py incubator/tashi/trunk/src/tashi/clustermanager/clustermanagerservice.py Modified: incubator/tashi/trunk/etc/TashiDefaults.cfg URL: http://svn.apache.org/viewvc/incubator/tashi/trunk/etc/TashiDefaults.cfg?rev=1304645&r1=1304644&r2=1304645&view=diff ============================================================================== --- incubator/tashi/trunk/etc/TashiDefaults.cfg (original) +++ incubator/tashi/trunk/etc/TashiDefaults.cfg Fri Mar 23 22:56:37 2012 @@ -54,6 +54,7 @@ allowDecayed = 30.0 allowMismatchedVersions = False maxMemory = 8192 maxCores = 8 +defaultNetwork = 0 allowDuplicateNames = False ;accountingHost = clustermanager ;accountingPort = 2228 Modified: incubator/tashi/trunk/src/tashi/client/tashi-client.py URL: http://svn.apache.org/viewvc/incubator/tashi/trunk/src/tashi/client/tashi-client.py?rev=1304645&r1=1304644&r2=1304645&view=diff ============================================================================== --- incubator/tashi/trunk/src/tashi/client/tashi-client.py (original) +++ incubator/tashi/trunk/src/tashi/client/tashi-client.py Fri Mar 23 22:56:37 2012 @@ -80,7 +80,7 @@ def getDefaultNetwork(): fetchNetworks() networkId = 1 for network in networks: - if (networks[network].name == "default"): + if (getattr(networks[network], "default", False) is True): networkId = network return networkId Modified: incubator/tashi/trunk/src/tashi/clustermanager/clustermanager.py URL: http://svn.apache.org/viewvc/incubator/tashi/trunk/src/tashi/clustermanager/clustermanager.py?rev=1304645&r1=1304644&r2=1304645&view=diff ============================================================================== --- incubator/tashi/trunk/src/tashi/clustermanager/clustermanager.py (original) +++ incubator/tashi/trunk/src/tashi/clustermanager/clustermanager.py Fri Mar 23 22:56:37 2012 @@ -1,4 +1,4 @@ -#!/usr/bin/env python +#!/usr/bin/python # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file Modified: incubator/tashi/trunk/src/tashi/clustermanager/clustermanagerservice.py URL: http://svn.apache.org/viewvc/incubator/tashi/trunk/src/tashi/clustermanager/clustermanagerservice.py?rev=1304645&r1=1304644&r2=1304645&view=diff ============================================================================== --- incubator/tashi/trunk/src/tashi/clustermanager/clustermanagerservice.py (original) +++ incubator/tashi/trunk/src/tashi/clustermanager/clustermanagerservice.py Fri Mar 23 22:56:37 2012 @@ -49,6 +49,13 @@ class ClusterManagerService(object): self.allowMismatchedVersions = boolean(self.config.get('ClusterManagerService', 'allowMismatchedVersions')) self.maxMemory = int(self.config.get('ClusterManagerService', 'maxMemory')) self.maxCores = int(self.config.get('ClusterManagerService', 'maxCores')) + + self.defaultNetwork = 0 + try: + self.defaultNetwork = int(self.config.get('ClusterManagerService', 'defaultNetwork')) + except: + pass + self.allowDuplicateNames = boolean(self.config.get('ClusterManagerService', 'allowDuplicateNames')) self.accountingHost = None @@ -538,7 +545,12 @@ class ClusterManagerService(object): return self.data.getHosts().values() def getNetworks(self): - return self.data.getNetworks().values() + networks = self.data.getNetworks() + if self.defaultNetwork in networks: + setattr(networks[self.defaultNetwork], "default", True) + + return networks.values() + def getUsers(self): return self.data.getUsers().values()