[asterisk-scf-commits] asterisk-scf/integration/configurator.git branch "master" updated.
Commits to the Asterisk SCF project code repositories
asterisk-scf-commits at lists.digium.com
Sun Mar 20 08:57:43 CDT 2011
branch "master" has been updated
via a9710935203651fdbe13bd2bd147bdc3c5df3a4f (commit)
from 38dd03fdce2ff014ad6de91788439b71af0e5f24 (commit)
Summary of changes:
Configurator.py | 16 ++++++++--------
1 files changed, 8 insertions(+), 8 deletions(-)
- Log -----------------------------------------------------------------
commit a9710935203651fdbe13bd2bd147bdc3c5df3a4f
Author: Joshua Colp <jcolp at digium.com>
Date: Sun Mar 20 10:59:24 2011 -0300
Incorporate feedback from code review.
diff --git a/Configurator.py b/Configurator.py
index 8bef119..84a45a4 100755
--- a/Configurator.py
+++ b/Configurator.py
@@ -2,7 +2,7 @@
# Asterisk SCF Configurator Module
-import ConfigParser, os, Ice, getopt
+import ConfigParser, os, Ice, getopt, sys
# Load and make the configuration interface available, we require it
Ice.loadSlice('-I. --all ConfigurationIf.ice')
@@ -33,7 +33,7 @@ class SectionVisitors():
def visit_unsupported(self, config, section):
"""Handle an unsupported configuration section"""
- print "Unsupported configuration section " + section
+ print >> sys.stderr, "Unsupported configuration section " + section
# Common option to item mapper implementation
class OptionMapper():
@@ -136,8 +136,8 @@ class ConfiguratorApp(Ice.Application):
configurationWipe = True
if configurationService == None:
- print "No configuration service to configure."
- return 0
+ print >> sys.stderr, "No configuration service to configure."
+ return -1
print "Reading configuration from file " + configFile
config = ConfigParser.ConfigParser()
@@ -146,8 +146,8 @@ class ConfiguratorApp(Ice.Application):
try:
config.readfp(open(configFile))
except IOError:
- print "Specified configuration file " + configFile + " could not be loaded."
- return 0
+ print >> sys.stderr, "Specified configuration file " + configFile + " could not be loaded."
+ return -1
print "Building configuration changes to send to component"
for section in config.sections():
@@ -162,8 +162,8 @@ class ConfiguratorApp(Ice.Application):
groups = configurationService.getConfigurationGroups()
configurationService.removeConfigurationGroups(groups)
except:
- print "Configuration could not be wiped - Failed to contact component"
- return 0
+ print >> sys.stderr, "Configuration could not be wiped - Failed to contact component"
+ return -1
print "Applying configuration"
-----------------------------------------------------------------------
--
asterisk-scf/integration/configurator.git
More information about the asterisk-scf-commits
mailing list