# Path: yubiadmin/default_settings.py
# USERNAME = "yubiadmin"
# PASSWORD = "yubiadmin"
# INTERFACE = "127.0.0.1"
# PORT = 8080


import sys
import os
import imp
import errno
import logging
import logging.config
from yubiadmin import default_settings
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.


__all__ = [
    'settings'
]

SETTINGS_FILE = os.getenv('YUBIADMIN_SETTINGS',
                          '/etc/yubico/admin/yubiadmin.conf')
LOG_CONFIG_FILE = os.path.join(os.path.dirname(os.path.abspath(SETTINGS_FILE)),
                               'logging.conf')

VALUES = {
    # Web interface
    'USERNAME': 'user',
    'PASSWORD': 'pass',
    'INTERFACE': 'iface',
    'PORT': 'port'
}


def parse(conf, settings={}):
    for confkey, settingskey in VALUES.items():
        if hasattr(conf, confkey):

# Path: yubiadmin/default_settings.py
# USERNAME = "yubiadmin"
# PASSWORD = "yubiadmin"
# INTERFACE = "127.0.0.1"
# PORT = 8080


# Path: yubiadmin/config.py
import sys
import os
import imp
import errno
import logging
import logging.config
from yubiadmin import default_settings

# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.


__all__ = [
    'settings'
]

SETTINGS_FILE = os.getenv('YUBIADMIN_SETTINGS',
                          '/etc/yubico/admin/yubiadmin.conf')
LOG_CONFIG_FILE = os.path.join(os.path.dirname(os.path.abspath(SETTINGS_FILE)),
                               'logging.conf')

VALUES = {
    # Web interface
    'USERNAME': 'user',
    'PASSWORD': 'pass',
    'INTERFACE': 'iface',
    'PORT': 'port'
}


def parse(conf, settings={}):
    for confkey, settingskey in VALUES.items():
        if hasattr(conf, confkey):

            settings[settingskey] = getattr(conf, confkey)