I have a set of ("default") tags that exist within a tag provider that I want to make sure also exist in Vision's [Client] tag provider. I'm trying to achieve this using the following steps:
- Browse the "default" tags using
system.tag.browse()recursively. - Substitute
[client]in the fullPath to get the equivalent vision client tag path. - Use
system.tag.exists()to see if the client tag exists. - Use
system.tag.getConfiguration()to get the default configuration. - Use
system.tag.configure()to set the new client tag's configuration from the default configuration.
I'm just having trouble with the last step.
#get default tags
defaultTags = system.tag.browse('Vision_Client_Defaults', {'recursive':True, 'tagType':'AtomicTag'})
for i, tag in enumerate(defaultTags):
#default tag path
defaultPath = str(tag['fullPath'])
#client tag path
clientPath = '[client]' + defaultPath.split('Vision_Client_Defaults/',1)[1]
#check to see if client tag exists
if not system.tag.exists(clientPath):
#get the default tag configuration
defaultConfig = system.tag.getConfiguration(defaultPath, False)[0]
#get the client tag base path
clientTagBasePath = clientPath.rsplit('/',1)[0]
#create the client tag
system.tag.configure(clientTagBasePath, defaultConfig)
I get a Provider not found: client error. I'm guessing it's a scope issue? (just testing, running from the script console).