Skip to content

Commit

Permalink
chg: dev: Upgrade docker library version
Browse files Browse the repository at this point in the history
  • Loading branch information
dajose authored and carlos-jenkins committed Nov 15, 2019
1 parent 57b1086 commit 228606c
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 20 deletions.
1 change: 1 addition & 0 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,7 @@
def setup(app):
app.add_stylesheet('styles/custom.css')


# autoapi configuration
autoapi_modules = {
'topology_docker': None
Expand Down
4 changes: 2 additions & 2 deletions lib/topology_docker/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2016 Hewlett Packard Enterprise Development LP
# Copyright (C) 2015-2018 Hewlett Packard Enterprise Development LP
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -24,4 +24,4 @@

__author__ = 'Hewlett Packard Enterprise Development LP'
__email__ = '[email protected]'
__version__ = '1.6.0'
__version__ = '1.7.0'
6 changes: 3 additions & 3 deletions lib/topology_docker/node.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2016 Hewlett Packard Enterprise Development LP
# Copyright (C) 2015-2018 Hewlett Packard Enterprise Development LP
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -31,7 +31,7 @@
from subprocess import check_output
from abc import ABCMeta, abstractmethod

from docker import Client
from docker import APIClient
from six import add_metaclass

from topology.platforms.node import CommonNode
Expand Down Expand Up @@ -125,7 +125,7 @@ def __init__(
self._command = command
self._hostname = hostname
self._environment = environment
self._client = Client(version='auto')
self._client = APIClient(version='auto')

self._container_name = '{identifier}_{pid}_{timestamp}'.format(
identifier=identifier, pid=getpid(),
Expand Down
12 changes: 6 additions & 6 deletions lib/topology_docker/platform.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2016 Hewlett Packard Enterprise Development LP
# Copyright (C) 2015-2018 Hewlett Packard Enterprise Development LP
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand All @@ -25,7 +25,7 @@
import logging
from traceback import format_exc
from collections import OrderedDict
from docker import Client
from docker import APIClient

from topology.platforms.utils import NodeLoader
from topology.platforms.platform import BasePlatform
Expand Down Expand Up @@ -293,14 +293,14 @@ def destroy(self):
for enode in self.nmlnode_node_map.values():
try:
enode.stop()
except:
except Exception:
log.error(format_exc())

# Remove the linked netns
for enode in self.nmlnode_node_map.values():
try:
privileged_cmd('rm /var/run/netns/{pid}', pid=enode._pid)
except:
except Exception:
log.error(format_exc())

# Save the names of all docker-managed networks
Expand All @@ -321,11 +321,11 @@ def destroy(self):

networks_to_remove.add(netname)

except:
except Exception:
log.error(format_exc())

# Remove all docker-managed networks
dockerclient = Client(version='auto')
dockerclient = APIClient(version='auto')
for netname in networks_to_remove:
dockerclient.remove_network(net_id=netname)

Expand Down
12 changes: 9 additions & 3 deletions lib/topology_docker/utils.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
#
# Copyright (C) 2015-2016 Hewlett Packard Enterprise Development LP
# Copyright (C) 2015-2018 Hewlett Packard Enterprise Development LP
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -160,5 +160,11 @@ def get_iface_name(enode, netname):

return iface

__all__ = ['ensure_dir', 'tmp_iface', 'cmd_prefix', 'privileged_cmd',
'get_iface_name']

__all__ = [
'ensure_dir',
'tmp_iface',
'cmd_prefix',
'privileged_cmd',
'get_iface_name'
]
3 changes: 1 addition & 2 deletions requirements.dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ flake8
pep8-naming

# Pytest framework
pytest===2.8.4
pytest
pytest-cov
pytest-logging

# Documentation
sphinx
Expand Down
3 changes: 2 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
six
docker-py==1.10.4
docker
topology>=1.8.0
pyparsing==2.2.2
6 changes: 3 additions & 3 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py27, py34, coverage, doc
envlist = py27, py3, coverage, doc

[testenv]
passenv = http_proxy https_proxy
Expand All @@ -15,7 +15,7 @@ commands =
{envsitepackagesdir}/topology_docker

[testenv:coverage]
basepython = python3.4
basepython = python3
commands =
py.test \
--junitxml=tests.xml \
Expand All @@ -28,7 +28,7 @@ commands =
{envsitepackagesdir}/topology_docker

[testenv:doc]
basepython = python3.4
basepython = python3
whitelist_externals =
dot
commands =
Expand Down

0 comments on commit 228606c

Please sign in to comment.