
* Added WebUI automated tests Ie5dd067f52d4906fc30ac11e820296b7dc797882 * Added scripts for HA testing Ib2d7f28458de3fe55f80f3e0955637ba907784b6 * Fixed README. I677705d7bc1199632b034f4111fa72ba24ddd71f * Fixed README again. I489578ff1f51685b4b62193f4cd5e61ce8092087 * Fixed IP address in automated tests for API Service I10571eec95f9b3ad8e0af0847da94a22a9847b84 Change-Id: I36bc87ec21c3082fe1502a5191c032dc67224bf0
55 lines
1.7 KiB
Python
55 lines
1.7 KiB
Python
# Copyright (c) 2013 Mirantis, Inc.
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
|
# not use this file except in compliance with the License. You may obtain
|
|
# a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
# License for the specific language governing permissions and limitations
|
|
# under the License.
|
|
|
|
from ConfigParser import ConfigParser
|
|
from os import getcwd
|
|
from os.path import join
|
|
|
|
from robot.libraries.BuiltIn import BuiltIn
|
|
|
|
|
|
_settingsFileName = 'settings.ini'
|
|
|
|
|
|
class _SettingsReader(object):
|
|
""" 'settings.ini' driver. """
|
|
|
|
@staticmethod
|
|
def read():
|
|
"""
|
|
Loads default variables from the 'resources/settings.ini' file.
|
|
|
|
Arguments:
|
|
- None.
|
|
|
|
Return:
|
|
- None.
|
|
"""
|
|
try:
|
|
p = BuiltIn().get_variable_value('${resources_path}')
|
|
if p is not None:
|
|
_settingsFullFileName = join(p, _settingsFileName)
|
|
else:
|
|
_settingsFullFileName = join(getcwd(), 'resources',
|
|
_settingsFileName)
|
|
|
|
conf = ConfigParser()
|
|
conf.read(_settingsFullFileName)
|
|
|
|
for setting in conf.options('default'):
|
|
BuiltIn().set_global_variable('${%s}' % setting,
|
|
conf.get('default', setting))
|
|
except:
|
|
pass
|