@@ -50,31 +50,8 @@ def load_components_and_configurations(self,force=False):
5050 nconfs = 0
5151 # retrieve components and configurations for this project
5252 if not self .is_optin :
53- logger .debug ( f"{ self .is_optin = } " )
54- # get the default configuration
55- projx = self .execute_get_xml ( self .reluri ( 'rm-projects/' + self .iid ), intent = "Retrieve the project definition (opt-out)" )
56- compsu = rdfxml .xmlrdf_get_resource_text ( projx , './/jp06:components' )
57- compsx = self .execute_get_xml (compsu , intent = "Retrieve the component definition (opt-out)" )
58- defaultcompu = rdfxml .xmlrdf_get_resource_uri ( compsx , './/oslc_config:component' )
59-
60- # register the only component
61- ncomps += 1
62- self ._components [defaultcompu ] = {'name' : self .name , 'configurations' : {}}
63- thisconfu = defaultcompu + "/configurations"
64- configs = self .execute_get_json ( thisconfu , intent = "Retrieve all configurations (opt-out)" )
65- configdetails = configs [defaultcompu + "/configurations" ]
66- if type (configs [thisconfu ]["http://www.w3.org/2000/01/rdf-schema#member" ])== dict :
67- confs = [configs [thisconfu ]["http://www.w3.org/2000/01/rdf-schema#member" ]]
68- else :
69- confs = configs [thisconfu ]["http://www.w3.org/2000/01/rdf-schema#member" ]
70- for aconf in confs :
71- confu = aconf ['value' ]
72- confx = self .execute_get_xml ( confu , intent = "Retrieve configuration definition (opt-out)" )
73- conftitle = rdfxml .xmlrdf_get_resource_text (confx ,'.//dcterms:title' )
74- conftype = 'Stream' if 'stream' in confu else 'Baseline'
75- self ._components [defaultcompu ]['configurations' ][confu ] = {'name' : conftitle , 'conftype' : conftype , 'confXml' : confx }
76- self ._configurations [defaultcompu ] = self ._components [defaultcompu ]['configurations' ][confu ]
77- nconfs += 1
53+ # for QM, no configs to load!
54+ return
7855 elif self .singlemode :
7956 logger .debug ( f"{ self .singlemode = } " )
8057 #get the single component from a QueryCapability
@@ -123,9 +100,11 @@ def load_components_and_configurations(self,force=False):
123100
124101 components_uri = rdfxml .xmlrdf_get_resource_uri (cmsp_xml , './/rdf:Description/rdf:type[@rdf:resource="http://open-services.net/ns/core#QueryCapability"]/../oslc:resourceType[@rdf:resource="http://open-services.net/ns/config#Component"]/../oslc:queryBase' )
125102 logger .info ( f"{ components_uri = } " )
103+ print ( f"{ components_uri = } " )
126104 # get all components
127105 crx = self .execute_get_xml ( components_uri , intent = "Retrieve component definition" )
128-
106+ logger .info ( f"{ crx = } " )
107+ print ( f"{ crx = } " )
129108# <oslc_config:Component rdf:about="https://jazz.ibm.com:9443/qm/oslc_config/resources/com.ibm.team.vvc.Component/_iw4s4EB3Eeus6Zk4qsm_Cw">
130109# <dcterms:title rdf:parseType="Literal">SGC Agile</dcterms:title>
131110# <oslc:instanceShape rdf:resource="https://jazz.ibm.com:9443/qm/oslc_config/resourceShapes/com.ibm.team.vvc.Component"/>
@@ -226,11 +205,14 @@ def get_local_component_details(self):
226205 return results
227206
228207 def find_local_component (self , name_or_uri ):
229- self .load_components_and_configurations ()
230- for compuri , compdetail in self ._components .items ():
231- logger .info ( f"Checking { name_or_uri } { compdetail } " )
232- if compuri == name_or_uri or compdetail ['name' ] == name_or_uri :
233- return compdetail ['component' ]
208+ if self .is_optin :
209+ self .load_components_and_configurations ()
210+ for compuri , compdetail in self ._components .items ():
211+ logger .info ( f"Checking { name_or_uri } { compdetail } " )
212+ if compuri == name_or_uri or compdetail ['name' ] == name_or_uri :
213+ return compdetail ['component' ]
214+ else :
215+ return self
234216 return None
235217
236218 def _create_component_api (self , component_prj_url , component_name ):
0 commit comments