Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scope 32 5 1 2 #9

Open
wants to merge 2 commits into
base: tag-32-5-1
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion lib/rucio/common/schema/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.

#import logging
import importlib
from configparser import NoOptionError, NoSectionError
from os import environ
Expand Down Expand Up @@ -65,6 +66,7 @@


def load_schema_for_vo(vo):
#logging.error('load_schema_for_vo ***********************************YG')
GENERIC_FALLBACK = 'generic_multi_vo'
if config.config_has_section('policy'):
try:
Expand All @@ -75,22 +77,25 @@ def load_schema_for_vo(vo):
POLICY = config.config_get('policy', 'package-' + vo, check_config_table=False)
check_policy_package_version(POLICY)
POLICY = POLICY + ".schema"
#logging.error(f'POLICY1: {POLICY}')
except (NoOptionError, NoSectionError):
# fall back to old system for now
try:
POLICY = config.config_get('policy', 'schema', check_config_table=False)
except (NoOptionError, NoSectionError):
POLICY = GENERIC_FALLBACK
POLICY = 'rucio.common.schema.' + POLICY.lower()
#logging.error(f'POLICY2: {POLICY}')
else:
POLICY = 'rucio.common.schema.' + GENERIC_FALLBACK.lower()

#logging.error(f'POLICY3: {POLICY}')
try:
module = importlib.import_module(POLICY)
except ImportError:
raise exception.PolicyPackageNotFound('Module ' + POLICY + ' not found')

schema_modules[vo] = module
#logging.error(f'module: {module}')


def validate_schema(name, obj, vo='def'):
Expand Down
6 changes: 6 additions & 0 deletions lib/rucio/web/rest/flaskapi/v1/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,12 @@ def parse_scope_name(scope_name, vo):
:returns: a (scope, name) tuple.
"""
# why again does that regex start with a slash?
logging.error('***********************************YG')
logging.error(f'vo: {vo}')
logging.error(f'scope_name: {scopr_name}')
logging.error(f'SCOPE_NAME_REGEXP: {get_schema_value('SCOPE_NAME_REGEXP', vo)}')
logging.error('***********************************YG')

scope_name = re.match(get_schema_value('SCOPE_NAME_REGEXP', vo), '/' + scope_name)
if scope_name is None:
raise ValueError('cannot parse scope and name')
Expand Down
Loading