diff --git a/src/rougail/user-data-environment/data.py b/src/rougail/user-data-environment/data.py index abb8136..c50e64e 100644 --- a/src/rougail/user-data-environment/data.py +++ b/src/rougail/user-data-environment/data.py @@ -19,6 +19,8 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA """ +from .helper import get_rougail_environment_var, get_rougail_environment_dict + from rougail.object_model import CONVERT_OPTION from rougail.config import RougailConfig from tiramisu.error import ValueOptionError @@ -88,20 +90,18 @@ class RougailUserDataEnvironment: type_obj = None type_obj = CONVERT_OPTION.get(option_type, {}).get("func") - from .helper import get_rougail_environment_var, get_rougail_environment_dict +# print(CONVERT_OPTION) + rougail_environment_var = get_rougail_environment_var() option_name = option.path() if option_name in rougail_environment_var: - option.value.set(get_rougail_environment_dict()[option_name]) - #option.value.set(["78", "52"]) - # TODO - # - tester les var commençant par ROUGAIL_ - # 'ROUGAIL_' - # tester si c'est une multi - # le CONVERT_TYPE ne marchera pas si c'est une multi - # récupérer le nam de l'option pour voir si elle est dans l'env - - + if ismulti: + pass + option_bash_value = get_rougail_environment_dict()[option_name] + option_value = option_bash_value.split(",") + option.value.set(option_value) + else: + option.value.set(get_rougail_environment_dict()[option_name]) #RougailValidator.option = option #RougailValidator.option_type = {'type': option_type,