Skip to content

Commit 9fd05dd

Browse files
committed
Fixed problem with configuraiton headers needed when GCM isn't installed
1 parent abc3bf5 commit 9fd05dd

23 files changed

+2390
-1487
lines changed

elmclient/_newtypesystem.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ def load_ot( self, serverconnection, url, iscacheable=True, isused=False ):
285285
print( f"OT definition for {url} already present!" )
286286
return
287287
# get the URI and process all the attributes
288-
content_x = serverconnection.execute_get_xml( url, params={'oslc_config.context':serverconnection.local_config},headers={'Configuration-Context': None}, cacheable=iscacheable )
288+
content_x = serverconnection.execute_get_xml( url, params={'vvc.configuration':serverconnection.local_config},headers={'Configuration-Context': None}, cacheable=iscacheable )
289289
if content_x is None:
290290
burp
291291
modified = rdfxml.xmlrdf_get_resource_uri( content_x,'.//dcterms:modified', exceptionifnotfound=True )
@@ -313,7 +313,7 @@ def load_ad( self, serverconnection, url, iscacheable=True, isused=False ):
313313
# print( f"AD definition for {url} already present!" )
314314
return
315315
# get the URI and process all the attributes
316-
content_x = serverconnection.execute_get_xml( url, params={'oslc_config.context':serverconnection.local_config},headers={'Configuration-Context': None}, cacheable=iscacheable )
316+
content_x = serverconnection.execute_get_xml( url, params={'vvc.configuration':serverconnection.local_config},headers={'Configuration-Context': None}, cacheable=iscacheable )
317317
if content_x is None:
318318
burp
319319
modified = rdfxml.xmlrdf_get_resource_uri( content_x,'.//dcterms:modified', exceptionifnotfound=True )
@@ -340,7 +340,7 @@ def load_at( self, serverconnection, url, iscacheable=True, isused=False ):
340340
if not serverconnection.app.is_server_uri( url ):
341341
# print( f"AT Ignoring non-server URL {url}" )
342342
return
343-
content_x = serverconnection.execute_get_xml( url, params={'oslc_config.context':serverconnection.local_config},headers={'Configuration-Context': None}, cacheable=iscacheable )
343+
content_x = serverconnection.execute_get_xml( url, params={'vvc.configuration':serverconnection.local_config},headers={'Configuration-Context': None}, cacheable=iscacheable )
344344
if content_x is None:
345345
burp
346346
modified = rdfxml.xmlrdf_get_resource_uri( content_x,'.//dcterms:modified', exceptionifnotfound=True )
@@ -386,7 +386,7 @@ def load_lt( self, serverconnection, url, iscacheable=True, isused=False ):
386386
if url in self.lts:
387387
# print( f"LT definition for {url} already present!" )
388388
return
389-
content_x = serverconnection.execute_get_xml( url, params={'oslc_config.context':serverconnection.local_config},headers={'Configuration-Context': None}, cacheable=iscacheable )
389+
content_x = serverconnection.execute_get_xml( url, params={'vvc.configuration':serverconnection.local_config},headers={'Configuration-Context': None}, cacheable=iscacheable )
390390
if content_x is None:
391391
burp
392392
modified = rdfxml.xmlrdf_get_resource_uri( content_x,'.//dcterms:modified', exceptionifnotfound=True )

elmclient/_rm.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1494,7 +1494,7 @@ def process_represt_arguments( self, args, allapps ):
14941494
gcconfiguri = None
14951495
gcapp = allapps.get('gc',None)
14961496
if not gcapp and args.globalconfiguration:
1497-
raise Exception( "gc app must be specified in APPSTRINGS/-A (after the rm app) to use a global configuration - for exmaple use -A rm,gc" )
1497+
raise Exception( "gc app must be specified in APPSTRINGS/-A, after the rm app, to use a global configuration - for exmaple use -A rm,gc" )
14981498

14991499
# most queries need a project and configuration - projects queried without a config will return data from the default configuraiotn (the default component's initial stream)
15001500
if args.all or args.collection or args.module or args.view or args.typename or args.resourceID or args.moduleResourceID or args.coreResourceID or args.schema or args.attributes or args.titles or args.linksOnly or args.history or args.artifact_format=='views':
@@ -1541,7 +1541,7 @@ def process_represt_arguments( self, args, allapps ):
15411541

15421542
# get the query capability base URL
15431543
qcbase = gc_query_on.get_query_capability_uri("oslc_config:Configuration")
1544-
# query for a configuration with title
1544+
# query gcm for a configuration with title
15451545
print( f"querying for gc config {args.globalconfiguration}" )
15461546
conf = gc_query_on.execute_oslc_query( qcbase, whereterms=[['dcterms:title','=',f'"{args.globalconfiguration}"']], select=['*'], prefixes={rdfxml.RDF_DEFAULT_PREFIX["dcterms"]:'dcterms'})
15471547
if len( conf.keys() ) == 0:
@@ -1551,7 +1551,7 @@ def process_represt_arguments( self, args, allapps ):
15511551
gcconfiguri = list(conf.keys())[0]
15521552
logger.info( f"{gcconfiguri=}" )
15531553
logger.debug( f"{gcconfiguri=}" )
1554-
queryparams['oslc_config.context'] = gcconfiguri
1554+
queryparams['oslc_config.context'] = gcconfiguri # a GC configuration
15551555

15561556
# check the gc config uri exists - a GET from it shouldn't fail!
15571557
if not gcapp.check_valid_config_uri(gcconfiguri,raise_exception=False):
@@ -1597,15 +1597,23 @@ def process_represt_arguments( self, args, allapps ):
15971597
queryparams['targetConfigUri'] = targetconfig
15981598
queryparams['sourceConfigUri'] = config
15991599
else:
1600+
# opt-out
1601+
gcconfiguri = None
16001602
if not args.localconfiguration:
16011603
args.localconfiguration = f"{args.project} Initial Stream"
16021604
config = p.get_local_config(args.localconfiguration)
16031605
queryon=p
16041606
queryon.set_local_config(config,gcconfiguri)
1605-
queryparams['oslc_config.context'] = config or gcconfiguri
1607+
if gcconfiguri:
1608+
queryparams['oslc_config.context'] = gcconfiguri
1609+
else:
1610+
queryparams['vvc.configuration'] = config
16061611
if args.artifact_format=='comparison' and args.targetconfiguration:
1612+
# remove any configuration parameters!
16071613
if 'oslc_config.context' in queryparams:
16081614
del queryparams['oslc_config.context']
1615+
if 'vvc.configuration' in queryparams:
1616+
del queryparams['vvc.configuration']
16091617

16101618
if args.module:
16111619
# get the query capability base URL for requirements

elmclient/examples/batchquery.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ def do_tests(inputargs=None):
214214
print( f"Stopping after first failure, {rep} repetitions" )
215215
return
216216
else:
217-
print( f"Test {testnumber} passed!" )
217+
print( f"Test {testnumber} passed! (Failed={nfailed})" )
218218
npassed += 1
219219

220220
if not args.dryrun:

0 commit comments

Comments
 (0)