Skip to content

Commit cd80140

Browse files
authoredMar 1, 2018
Merge pull request #12 from DMTF/tag-check
Added termination if expected tags are lower-cased
2 parents ef1d106 + 5b10c66 commit cd80140

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed
 

‎RedfishReferenceTool.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ def checkInvalidTags(soup):
3939
print('The following tags were found that may be misspelled or the wrong case:')
4040
for tag in bad_tags:
4141
print(' ' + tag)
42+
return False
43+
return True
4244

4345

4446
def getSchemaFile(url, chkCert=False, to=30):
@@ -62,8 +64,7 @@ def getSchemaFile(url, chkCert=False, to=30):
6264
# check if file is returned and is legit XML
6365
if "xml" in doctype and status in [200, 204] and filedata:
6466
soup = BeautifulSoup(filedata, "xml")
65-
checkInvalidTags(soup)
66-
success = True
67+
success = checkInvalidTags(soup)
6768
except Exception as ex:
6869
print("Something went wrong: %s %s" % (ex, status), file=sys.stderr)
6970

@@ -81,7 +82,7 @@ def getRefs(soup):
8182
refs = [(ref.get('Uri'), ref) for ref in reftags]
8283
for cnt, url in enumerate(refs):
8384
if url is None:
84-
print("The Uri in this Reference #{} is missing, please check for capitalization of Uri".format(cnt))
85+
print("The Uri in this Reference #{} is missing, please check for capitalization of Uri".format(cnt), file=sys.stderr)
8586
return refs
8687

8788

@@ -103,9 +104,8 @@ def getAlias(uri, aliasDict):
103104
print(fileName)
104105
fileData = f.read()
105106
soup = BeautifulSoup(fileData, "xml")
106-
checkInvalidTags(soup)
107107
print("Using alias: {} {}".format(uri, fileName))
108-
return soup is not None, soup
108+
return soup is not None and checkInvalidTags(soup), soup
109109

110110

111111
if __name__ == "__main__":

0 commit comments

Comments
 (0)
Please sign in to comment.