Skip to content

Commit

Permalink
Merge pull request #50 from totem/develop
Browse files Browse the repository at this point in the history
0.4.5 Release
  • Loading branch information
sukrit007 committed Mar 2, 2016
2 parents 5209303 + 81d5fdb commit 1145382
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ services:

# command to install dependencies
install:
- "pip install -U pip"
- "pip install -r requirements.txt"
- "pip install -r dev-requirements.txt"

Expand Down
2 changes: 1 addition & 1 deletion deployer/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from celery.signals import setup_logging


__version__ = '0.4.4'
__version__ = '0.4.5'
__author__ = 'sukrit'

deployer.logger.init_logging()
Expand Down
4 changes: 3 additions & 1 deletion deployer/services/deployment.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ def get_exposed_ports(deployment):
{listener.get('upstream-port')
for listener in deployment.get('proxy', {}).get('listeners', {})
.values()
}
} |
{int(port) for port in deployment.get('proxy', {}).get(
'upstreams', {})}
)


Expand Down
11 changes: 8 additions & 3 deletions tests/unit/services/test_deployment.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def test_get_exposed_ports_with_no_proxy():
eq_(ports, [])


def test_get_exposed_ports_with_hosts_and_listeners():
def test_get_exposed_ports_with_hosts_listeners_and_upstreams():

# Given: Deployment parameters
deployment = _create_test_deployment()
Expand Down Expand Up @@ -77,6 +77,11 @@ def test_get_exposed_ports_with_hosts_and_listeners():
'ssh': {
'upstream-port': 22
}
},
'upstreams': {
'8080': {},
'8022': {},
'8122': {}
}
}

Expand All @@ -85,8 +90,8 @@ def test_get_exposed_ports_with_hosts_and_listeners():
# When: I get exposed ports for deployment
ports = get_exposed_ports(deployment)

# Then: Empty set is returned
eq_(ports, [22, 8080, 8081, 8082])
# Then: Exposed ports are returned
eq_(ports, [22, 8022, 8080, 8081, 8082, 8122])


@patch('deployer.services.deployment.get_discovered_nodes')
Expand Down

0 comments on commit 1145382

Please sign in to comment.