From d8e4f1ab98b32b8492fbb6f36d30a3cddf5ac770 Mon Sep 17 00:00:00 2001 From: = Date: Tue, 31 Oct 2017 13:48:31 -0400 Subject: [PATCH] addessing requested changes --- docs/guide/taxii.ipynb | 2 +- stix2/sources/taxii.py | 11 +++-------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/docs/guide/taxii.ipynb b/docs/guide/taxii.ipynb index d44b12e..016f9d8 100644 --- a/docs/guide/taxii.ipynb +++ b/docs/guide/taxii.ipynb @@ -110,7 +110,7 @@ "from taxii2client import Collection\n", "\n", "# establish TAXII2 Collection instance\n", - "collection = Collection(\"http://127.0.0.1:5000/trustgroup1/collections/91a7b528-80eb-42ed-a74d-c6fbd5a26116/\", user=\"admin\", password=\"password\")\n", + "collection = Collection(\"http://127.0.0.1:5000/trustgroup1/collections/91a7b528-80eb-42ed-a74d-c6fbd5a26116/\", user=\"admin\", password=\"Password0\")\n", "# supply the TAXII2 collection to TAXIICollection\n", "tc_source = TAXIICollectionSource(collection)\n", "\n", diff --git a/stix2/sources/taxii.py b/stix2/sources/taxii.py index 5dcd9f2..4c659ed 100644 --- a/stix2/sources/taxii.py +++ b/stix2/sources/taxii.py @@ -1,10 +1,5 @@ """ -Python STIX 2.x -Classes: - TAXIICollectionStore - TAXIICollectionSink - TAXIICollectionSource - +Python STIX 2.x TaxiiCollectionStore """ from stix2.base import _STIXBase @@ -122,7 +117,7 @@ class TAXIICollectionSource(DataSource): # as directly retrieveing a STIX object by ID stix_objs = self.collection.get_object(stix_id)["objects"] - stix_obj = [apply_common_filters(stix_objs, query)] + stix_obj = list(apply_common_filters(stix_objs, query)) if len(stix_obj): stix_obj = parse(stix_obj[0]) @@ -190,7 +185,7 @@ class TAXIICollectionSource(DataSource): if not isinstance(query, list): # make sure dont make set from a Filter object, # need to make a set from a list of Filter objects (even if just one Filter) - query = list(query) + query = [query] query = set(query) # combine all query filters