Browse Source

Merge "Allow Iotronic-Api to run in python2.7"

Zuul 6 months ago
parent
commit
683d52042c
1 changed files with 8 additions and 1 deletions
  1. 8
    1
      iotronic/conductor/endpoints.py

+ 8
- 1
iotronic/conductor/endpoints.py View File

@@ -13,7 +13,14 @@
13 13
 #    License for the specific language governing permissions and limitations
14 14
 #    under the License.
15 15
 
16
-import _pickle as cpickle
16
+
17
+try:
18
+    # allow iotronic api to run also with python3
19
+    import _pickle as cpickle
20
+except Exception:
21
+    # allow iotronic api to run also with python2.7
22
+    import pickle as cpickle
23
+
17 24
 from iotronic.common import exception
18 25
 from iotronic.common import neutron
19 26
 from iotronic.common import states

Loading…
Cancel
Save