SAAS-560: Deploy separate cloud storage config files for each development environment
Changed analyzer upstart to take the cloud storage config file as a command line option Dropped the dev env portion from the rabbitmq-analyzer.ini filename
This commit is contained in:
parent
7808fd4708
commit
7b3f9af04c
7 changed files with 29 additions and 36 deletions
|
@ -9,6 +9,7 @@ import airtime_analyzer.airtime_analyzer as aa
|
|||
|
||||
VERSION = "1.0"
|
||||
DEFAULT_CONFIG_PATH = '/etc/airtime/airtime.conf'
|
||||
DEFAULT_CLOUD_STORAGE_CONFIG_PATH = '/etc/airtime-saas/production/cloud_storage.conf'
|
||||
DEFAULT_HTTP_RETRY_PATH = '/tmp/airtime_analyzer_http_retries'
|
||||
|
||||
def run():
|
||||
|
@ -18,6 +19,7 @@ def run():
|
|||
parser.add_argument("-d", "--daemon", help="run as a daemon", action="store_true")
|
||||
parser.add_argument("--debug", help="log full debugging output", action="store_true")
|
||||
parser.add_argument("--rmq-config-file", help="specify a configuration file with RabbitMQ settings (default is %s)" % DEFAULT_CONFIG_PATH)
|
||||
parser.add_argument("--cloud-storage-config-file", help="specify a configuration file with cloud storage settings (default is %s)" % DEFAULT_CLOUD_STORAGE_CONFIG_PATH)
|
||||
parser.add_argument("--http-retry-queue-file", help="specify where incompleted HTTP requests will be serialized (default is %s)" % DEFAULT_HTTP_RETRY_PATH)
|
||||
args = parser.parse_args()
|
||||
|
||||
|
@ -25,20 +27,25 @@ def run():
|
|||
|
||||
#Default config file path
|
||||
config_path = DEFAULT_CONFIG_PATH
|
||||
cloud_storage_config_path = DEFAULT_CLOUD_STORAGE_CONFIG_PATH
|
||||
http_retry_queue_path = DEFAULT_HTTP_RETRY_PATH
|
||||
if args.rmq_config_file:
|
||||
config_path = args.rmq_config_file
|
||||
if args.cloud_storage_config_file:
|
||||
cloud_storage_config_path = args.cloud_storage_config_file
|
||||
if args.http_retry_queue_file:
|
||||
http_retry_queue_path = args.http_retry_queue_file
|
||||
|
||||
if args.daemon:
|
||||
with daemon.DaemonContext():
|
||||
aa.AirtimeAnalyzerServer(config_path=config_path,
|
||||
aa.AirtimeAnalyzerServer(config_path=config_path,
|
||||
cloud_storage_config_path = cloud_storage_config_path,
|
||||
http_retry_queue_path=http_retry_queue_path,
|
||||
debug=args.debug)
|
||||
else:
|
||||
# Run without daemonizing
|
||||
aa.AirtimeAnalyzerServer(config_path=config_path,
|
||||
cloud_storage_config_path = cloud_storage_config_path,
|
||||
http_retry_queue_path=http_retry_queue_path,
|
||||
debug=args.debug)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue