Skip to content

Commit

Permalink
Core: set_metadata of is_new fails; Fix rucio#4192
Browse files Browse the repository at this point in the history
  • Loading branch information
bari12 authored and maany committed Jan 21, 2021
1 parent e279743 commit 9111684
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/rucio/core/did_meta_plugins/did_column_meta.py
Expand Up @@ -15,7 +15,7 @@
#
# Authors:
# - Vincent Garonne <vgaronne@gmail.com>, 2013-2018
# - Martin Barisits <martin.barisits@cern.ch>, 2013-2019
# - Martin Barisits <martin.barisits@cern.ch>, 2013-2020
# - Cedric Serfon <cedric.serfon@cern.ch>, 2013-2020
# - Ralph Vigne <ralph.vigne@cern.ch>, 2013
# - Mario Lassnig <mario.lassnig@cern.ch>, 2013-2019
Expand Down Expand Up @@ -81,6 +81,7 @@
"is_archive",
"constituent",
"access_cnt",
"is_new",

# Keys used while listing dids
"created_before",
Expand Down
16 changes: 15 additions & 1 deletion lib/rucio/tests/test_meta_did.py
@@ -1,4 +1,5 @@
# Copyright 2012-2020 CERN for the benefit of the ATLAS collaboration.
# -*- coding: utf-8 -*-
# Copyright 2012-2020 CERN
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -16,6 +17,7 @@
# - Vincent Garonne <vincent.garonne@cern.ch>, 2012-2014
# - Mario Lassnig <mario.lassnig@cern.ch>, 2013-2017
# - Benedikt Ziemons <benedikt.ziemons@cern.ch>, 2020
# - Martin Barisits <martin.barisits@cern.ch>, 2020

import unittest

Expand Down Expand Up @@ -56,3 +58,15 @@ def test_add_list_meta(self):
meta = self.did_client.get_metadata(scope=tmp_scope, name=tmp_dataset)
assert key in meta
assert meta[key] == value

def test_set_is_new_meta(self):
""" META DID (CLIENTS): Try to set is_new metadata"""
# Add a scope
tmp_scope = 'mock'

# Add a dataset
tmp_dataset = 'dsn_%s' % uuid()

self.did_client.add_dataset(scope=tmp_scope, name=tmp_dataset)

self.did_client.set_metadata(scope=tmp_scope, name=tmp_dataset, key='is_new', value=True)

0 comments on commit 9111684

Please sign in to comment.