f59302d0d8aafc18d42d0e56e8c8a1d9b30f5af6,sbin/db_mgmt_capec.py,,,#,158

Before Change


    f = Configuration.getFile(capecurl)
except:
    sys.exit("Cannot open url %s. Bad URL or not connected to the internet?"%(capecurl))
i = info.find_one({"db": "capec"})
if i is not None:
    if f.headers["last-modified"] == i["last-modified"]:
        print("Not modified")
        sys.exit(0)
// parse xml and store in database
parser.parse(f)
bulk = capec.initialize_ordered_bulk_op()
for attack in progressbar(ch.capec):
    bulk.find({"id": attack["id"]}).upsert().update({"$set": {"name": attack["name"], "summary": attack["summary"], "prerequisites": attack["prerequisites"], "solutions": attack["solutions"], "related_weakness": attack["related_weakness"]}})
bulk.execute()

//update database info after successful program-run
info.update({"db": "capec"}, {"$set": {"last-modified": f.headers["last-modified"]}}, upsert=True)

After Change


    f = Configuration.getFile(capecurl)
except:
    sys.exit("Cannot open url %s. Bad URL or not connected to the internet?"%(capecurl))
i = dbLayer.getLastModified("capec")
if i is not None:
    if f.headers["last-modified"] == i:
        print("Not modified")
        sys.exit(0)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 14

Instances


Project Name: cve-search/cve-search
Commit Name: f59302d0d8aafc18d42d0e56e8c8a1d9b30f5af6
Time: 2015-10-21
Author: pieterjan.moreels@gmail.com
File Name: sbin/db_mgmt_capec.py
Class Name:
Method Name:


Project Name: cve-search/cve-search
Commit Name: 84a7ed3ad3a03873ecedd6962ddd886f0b4dab89
Time: 2015-10-16
Author: pieterjan.moreels@gmail.com
File Name: sbin/db_mgmt_cwe.py
Class Name:
Method Name:


Project Name: cve-search/cve-search
Commit Name: 7fcbf3e1e8b59897042e01c8c07236ce7bc4c010
Time: 2015-09-25
Author: pieterjan.moreels@gmail.com
File Name: sbin/db_mgmt_d2sec.py
Class Name:
Method Name:


Project Name: cve-search/cve-search
Commit Name: f59302d0d8aafc18d42d0e56e8c8a1d9b30f5af6
Time: 2015-10-21
Author: pieterjan.moreels@gmail.com
File Name: sbin/db_mgmt_capec.py
Class Name:
Method Name: