# Path: lava_dispatcher/action.py
# class JobError(LAVAError):
#     """
#     An Error arising from the information supplied as part of the TestJob
#     e.g. HTTP404 on a file to be downloaded as part of the preparation of
#     the TestJob or a download which results in a file which tar or gzip
#     does not recognise.
#     """
#     error_help = "JobError: Your job cannot terminate cleanly."
#     error_type = "Job"


import sys
from lava_dispatcher.action import JobError
#
# Author: Antonio Terceiro <antonio.terceiro@linaro.org>
#
# This file is part of LAVA Dispatcher.
#
# LAVA Dispatcher is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# LAVA Dispatcher is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses>.



def get_deployment_data(distro):
    """
    Returns the deployment data by name, for the cases where we actually need that.
    """
    if distro is '':
        raise JobError("Missing 'os' value for deployment - unable to identify operating system for deployment data.")
    this_module = sys.modules[__name__]
    try:
        return getattr(this_module, distro)
    except AttributeError:

# Path: lava_dispatcher/action.py
# class JobError(LAVAError):
#     """
#     An Error arising from the information supplied as part of the TestJob
#     e.g. HTTP404 on a file to be downloaded as part of the preparation of
#     the TestJob or a download which results in a file which tar or gzip
#     does not recognise.
#     """
#     error_help = "JobError: Your job cannot terminate cleanly."
#     error_type = "Job"


# Path: lava_dispatcher/deployment_data.py
import sys
from lava_dispatcher.action import JobError

#
# Author: Antonio Terceiro <antonio.terceiro@linaro.org>
#
# This file is part of LAVA Dispatcher.
#
# LAVA Dispatcher is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# LAVA Dispatcher is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses>.



def get_deployment_data(distro):
    """
    Returns the deployment data by name, for the cases where we actually need that.
    """
    if distro is '':
        raise JobError("Missing 'os' value for deployment - unable to identify operating system for deployment data.")
    this_module = sys.modules[__name__]
    try:
        return getattr(this_module, distro)
    except AttributeError:

        raise JobError("%s is not a supported distribution" % distro)