Use sanitized orgname in STIX header

pull/2493/head
Richie B2B 2017-09-19 13:40:08 +02:00 committed by GitHub
parent ecda724315
commit 83dce8191e
1 changed files with 3 additions and 3 deletions

View File

@ -103,18 +103,18 @@ def main(args):
NS_DICT[namespace[0]]=namespace[1]
try:
idgen.set_id_namespace({baseURL: orgname})
idgen.set_id_namespace({baseURL: namespace[1]})
except ValueError:
# Some weird stix error that sometimes occurs if the stars
# align and Mixbox is being mean to us
# Glory to STIX, peace and good xmlns be upon it
try:
idgen.set_id_namespace(Namespace(baseURL, orgname))
idgen.set_id_namespace(Namespace(baseURL, namespace[1]))
except TypeError:
# Ok this only occurs if the script is being run under py3
# and if we're running a REALLY weird version of stix
# May as well catch it
idgen.set_id_namespace(Namespace(baseURL, orgname, "MISP"))
idgen.set_id_namespace(Namespace(baseURL, namespace[1], "MISP"))
stix_package = STIXPackage()