Browse code

Fix generate osstp ticket failure

Change-Id: I4e344e8af0dd3f33e45fb26c5e4d8414d100fe64
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/6276
Tested-by: michellew <michellew@vmware.com>
Reviewed-by: Sharath George

michellew-vmware authored on 2018/12/04 07:44:40
Showing 2 changed files
... ...
@@ -102,7 +102,7 @@ def main():
102 102
     sys.exit(0)
103 103
 
104 104
 
105
-def get_baseurl(self, conf_file):
105
+def get_baseurl(conf_file):
106 106
     with open(conf_file) as jsonFile:
107 107
         config = json.load(jsonFile)
108 108
     return config['baseurl']
... ...
@@ -168,7 +168,8 @@ def buildSourcesList(yamlDir, blackListPkgs, logger, singleFile=True):
168 168
                 sha1 = SPECS.getData().getSHA1(package, version, sourceName)
169 169
                 if sha1 is not None:
170 170
                     PullSources.get(package, sourceName, sha1, yamlSourceDir,
171
-                                    constants.getPullSourcesURLs(package), logger)
171
+                                    constants.getPullSourcesURLs(package),
172
+                                    logger)
172 173
 
173 174
             if not singleFile:
174 175
                 yamlFile = open(yamlSourceDir + "/" + ossname + "-" + version + ".yaml", "w")
... ...
@@ -361,7 +361,8 @@ class constants(object):
361 361
     def getPullSourcesURLs(packageName):
362 362
         urls=[]
363 363
         urls.append(constants.pullsourcesURL)
364
-        urls.extend(constants.extrasourcesURLs[packageName])
364
+        if packageName in constants.extrasourcesURLs:
365
+            urls.extend(constants.extrasourcesURLs[packageName])
365 366
         return urls
366 367
 
367 368
     @staticmethod