Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
ARIA-392 Failing to load ruamel.yaml
  • Loading branch information
mxmrlv committed Nov 8, 2017
1 parent 19e95f7 commit 730750f3d8f8173dccf58c935b0eb27b548539d9
Showing 9 changed files with 59 additions and 11 deletions.
@@ -17,14 +17,13 @@
The ARIA root package provides entry points for extension and storage initialization.
"""

import sys

from pkgutil import iter_modules
import pkg_resources

aria_package_name = 'apache-ariatosca'
__version__ = pkg_resources.get_distribution(aria_package_name).version


from .orchestrator.decorators import workflow, operation # pylint: disable=wrong-import-position
from . import ( # pylint: disable=wrong-import-position
extension,
@@ -19,10 +19,11 @@

import os
import pkg_resources
from ruamel import yaml

from jinja2.environment import Template

from ...utils.yaml import yaml


CONFIG_FILE_NAME = 'config.yaml'

@@ -27,7 +27,7 @@
import zipfile

import requests
from ruamel import yaml
from ..utils.yaml import yaml

CSAR_FILE_EXTENSION = '.csar'
META_FILE = 'TOSCA-Metadata/TOSCA.meta'
@@ -19,7 +19,7 @@

import os
import glob
from ruamel import yaml
from ..utils.yaml import yaml

from .env import logger
from .exceptions import AriaCliError
@@ -26,7 +26,7 @@
event
)
from sqlalchemy.ext import mutable
from ruamel import yaml
from ..utils.yaml import yaml

from . import exceptions

@@ -10,7 +10,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

from ruamel import yaml # @UnresolvedImport
from ...utils.yaml import yaml # @UnresolvedImport

from ...utils.collections import OrderedDict
from .reader import Reader
@@ -20,8 +20,7 @@
import json
from types import MethodType

from ruamel import yaml # @UnresolvedImport

from .yaml import yaml # @UnresolvedImport
from .collections import FrozenList, FrozenDict, StrictList, StrictDict, OrderedDict


@@ -0,0 +1,50 @@
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You 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.

"""
The ARIA root package provides entry points for extension and storage initialization.
"""

import os
import sys
import types

try:
import ruamel # pylint: disable=unused-import
except ImportError:
if sys.version_info[0] > 2:
raise

# Traverse all of the site-packages and try to load ruamel.
for packages_dir in sys.path:
ruamel_path = os.path.join(packages_dir, 'ruamel')
if not os.path.exists(ruamel_path):
continue

# If the top dir has an __init__.py file, the loading should have
# succeeded automatically
if os.path.exists(os.path.join(ruamel_path, '__init__.py')):
raise

# Dynamically create mapping to the ruamel package
ruamel_module = sys.modules.setdefault(
'ruamel',
types.ModuleType('ruamel')
)
# add path to the mapped package
ruamel_module.__dict__.setdefault('__path__', []).append(ruamel_path)

finally:
from ruamel import yaml # pylint: disable=unused-import
@@ -23,14 +23,13 @@

import os
import re
from types import FunctionType
from datetime import datetime

from ruamel import yaml

from aria.parser.validation import Issue
from aria.utils.formatting import string_list_as_string
from aria.utils.collections import (StrictDict, OrderedDict)
from aria.utils.yaml import yaml
from aria.orchestrator import WORKFLOW_DECORATOR_RESERVED_ARGUMENTS
from aria.modeling.models import (Type, ServiceTemplate, NodeTemplate,
RequirementTemplate, RelationshipTemplate, CapabilityTemplate,

0 comments on commit 730750f

Please sign in to comment.