Hello community,

here is the log from the commit of package python-pymisp for openSUSE:Factory 
checked in at 2018-02-07 18:40:49
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-pymisp (Old)
 and      /work/SRC/openSUSE:Factory/.python-pymisp.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "python-pymisp"

Wed Feb  7 18:40:49 2018 rev:6 rq:573307 version:2.4.87

Changes:
--------
--- /work/SRC/openSUSE:Factory/python-pymisp/python-pymisp.changes      
2017-12-31 01:14:16.963816393 +0100
+++ /work/SRC/openSUSE:Factory/.python-pymisp.new/python-pymisp.changes 
2018-02-07 18:40:53.069668690 +0100
@@ -1,0 +2,14 @@
+Tue Jan 30 12:37:13 UTC 2018 - [email protected]
+
+- update to version 2.4.87:
+ - Add bindings for Galaxies and Taxonimies.
+ - Add bindings to PyMISPWarninglists.
+ - Raise an exception when distribution is sharing group, but the ID is
+   missing.
+ - Allow to pass a directory with custom object templates.
+ - Allow to pass value, UUID, or ID to a sighting.
+ - Add_hashes was broken. (#174)
+ - Add: Allow to fetch warninglists. (#180)
+- Add fix-Encode_string_in__encode_file_to_upload.patch to fix encoding 
problem (#183)
+
+-------------------------------------------------------------------

Old:
----
  pymisp-2.4.85.tar.gz

New:
----
  fix-Encode_string_in__encode_file_to_upload.patch
  pymisp-2.4.87.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ python-pymisp.spec ++++++
--- /var/tmp/diff_new_pack.fgel3T/_old  2018-02-07 18:40:53.669640585 +0100
+++ /var/tmp/diff_new_pack.fgel3T/_new  2018-02-07 18:40:53.673640397 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package python-pymisp
 #
-# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -20,13 +20,15 @@
 %{!?license: %global license %doc}
 %bcond_without test
 Name:           python-pymisp
-Version:        2.4.85
+Version:        2.4.87
 Release:        0
 Summary:        Python API for MISP
 License:        BSD-2-Clause
 Group:          Development/Languages/Python
 Url:            https://github.com/MISP/PyMISP
 Source:         
https://files.pythonhosted.org/packages/source/p/pymisp/pymisp-%{version}.tar.gz
+# PATCH_FIX_UPSTREAM: Fixes https://github.com/MISP/PyMISP/issues/183
+Patch0:         
https://github.com/MISP/PyMISP/commit/05bbfac658fb9f35ab773982b1c7dc94fbdbc96f.patch#/fix-Encode_string_in__encode_file_to_upload.patch
 BuildRequires:  %{python_module devel}
 BuildRequires:  %{python_module setuptools}
 BuildRequires:  fdupes
@@ -67,6 +69,7 @@
 
 %prep
 %setup -q -n pymisp-%{version}
+%patch0 -p1
 find pymisp examples -name "*.py" -type f -exec sed -i '1s/^#!.*//' '{}' \+
 
 %build

++++++ fix-Encode_string_in__encode_file_to_upload.patch ++++++
>From 05bbfac658fb9f35ab773982b1c7dc94fbdbc96f Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Rapha=C3=ABl=20Vinot?= <[email protected]>
Date: Mon, 29 Jan 2018 10:30:37 +0100
Subject: [PATCH] fix: Encode string in _encode_file_to_upload

---
 pymisp/api.py         | 21 ++++++++++++++++++---
 tests/test_offline.py |  4 ++--
 2 files changed, 20 insertions(+), 5 deletions(-)

diff --git a/pymisp/api.py b/pymisp/api.py
index e17e464e..ff21fa9c 100644
--- a/pymisp/api.py
+++ b/pymisp/api.py
@@ -815,9 +815,12 @@ def _prepare_upload(self, event_id, distribution, to_ids, 
category, comment, inf
 
     def _encode_file_to_upload(self, filepath_or_bytes):
         """Helper to encode a file to upload"""
-        if isinstance(filepath_or_bytes, basestring) and 
os.path.isfile(filepath_or_bytes):
-            with open(filepath_or_bytes, 'rb') as f:
-                binblob = f.read()
+        if isinstance(filepath_or_bytes, basestring):
+            if os.path.isfile(filepath_or_bytes):
+                with open(filepath_or_bytes, 'rb') as f:
+                    binblob = f.read()
+            else:
+                binblob = filepath_or_bytes.encode()
         else:
             binblob = filepath_or_bytes
         return base64.b64encode(binblob).decode()
@@ -1583,6 +1586,18 @@ def get_warninglist(self, warninglist_id):
         response = self.__prepare_request('GET', url)
         return self._check_response(response)
 
+    # ############## Galaxies/Clusters ##################
+
+    def get_galaxies(self):
+        url = urljoin(self.root_url, '/galaxies')
+        response = self.__prepare_request('GET', url)
+        return self._check_response(response)
+
+    def get_galaxy(self, galaxy_id):
+        url = urljoin(self.root_url, '/galaxies/view/{}'.format(galaxy_id))
+        response = self.__prepare_request('GET', url)
+        return self._check_response(response)
+
     # ##############################################
     # ############### Non-JSON output ##############
     # ##############################################
diff --git a/tests/test_offline.py b/tests/test_offline.py
index 53f0be83..1a1fd751 100644
--- a/tests/test_offline.py
+++ b/tests/test_offline.py
@@ -444,11 +444,11 @@ def test_download_samples(self, m):
         self.assertEqual((False, None), pymisp.download_samples())
 
     def test_sample_upload(self, m):
-        if (3, 0) < sys.version_info < (3, 5):
-            return unittest.SkipTest()
         self.initURI(m)
         pymisp = PyMISP(self.domain, self.key)
         upload = pymisp.upload_sample("tmux", 
"tests/viper-test-files/test_files/tmux", 1)
+        upload = pymisp.upload_sample("tmux", "non_existing_file", 1)
+        upload = pymisp.upload_sample("tmux", b"binblob", 1)
 
     def test_get_all_tags(self, m):
         self.initURI(m)
++++++ pymisp-2.4.85.tar.gz -> pymisp-2.4.87.tar.gz ++++++
++++ 16718 lines of diff (skipped)


Reply via email to