X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2FN2VC.git;a=blobdiff_plain;f=modules%2Flibjuju%2Fjuju%2Ftag.py;h=282e0a6edb2f5da1bb187b6c25bf31a3b725e364;hp=25142293141ca15eb390af5a15a0dafa91acd362;hb=e2051cca7dac12aa09f6ed33555dcc4548c4b52b;hpb=68858c1915122c2dbc8999a5cd3229694abf5f3a;ds=sidebyside diff --git a/modules/libjuju/juju/tag.py b/modules/libjuju/juju/tag.py index 2514229..282e0a6 100644 --- a/modules/libjuju/juju/tag.py +++ b/modules/libjuju/juju/tag.py @@ -1,3 +1,8 @@ +# TODO: Tags should be a proper class, so that we can distinguish whether +# something is already a tag or not. For example, 'user-foo' is a valid +# username, but is ambiguous with the already-tagged username 'foo'. + + def _prefix(prefix, s): if s and not s.startswith(prefix): return '{}{}'.format(prefix, s) @@ -29,3 +34,7 @@ def user(username): def application(app_name): return _prefix('application-', app_name) + + +def action(action_uuid): + return _prefix('action-', action_uuid)