mirror of
https://github.com/status-im/ansible-role-mongodb.git
synced 2025-01-11 22:14:15 +00:00
switch to python3
Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
parent
b3a1cf4059
commit
b6fad71e0c
@ -4,7 +4,7 @@ dist: trusty
|
|||||||
sudo: required
|
sudo: required
|
||||||
language: python
|
language: python
|
||||||
python:
|
python:
|
||||||
- "2.7.15"
|
- "3.6"
|
||||||
env:
|
env:
|
||||||
- >
|
- >
|
||||||
DISTRIBUTION=ubuntu
|
DISTRIBUTION=ubuntu
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
#!/usr/bin/env python2
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
# (c) 2015-2018, Sergei Antipov, 2GIS LLC
|
# (c) 2015-2018, Sergei Antipov, 2GIS LLC
|
||||||
#
|
#
|
||||||
@ -156,7 +156,7 @@ host_type:
|
|||||||
type: string
|
type: string
|
||||||
sample: "replica"
|
sample: "replica"
|
||||||
'''
|
'''
|
||||||
import ConfigParser
|
import configparser
|
||||||
import ssl as ssl_lib
|
import ssl as ssl_lib
|
||||||
import time
|
import time
|
||||||
from datetime import datetime as dtdatetime
|
from datetime import datetime as dtdatetime
|
||||||
@ -287,7 +287,7 @@ def remove_host(module, client, host_name, timeout=180):
|
|||||||
time.sleep(5)
|
time.sleep(5)
|
||||||
|
|
||||||
def load_mongocnf():
|
def load_mongocnf():
|
||||||
config = ConfigParser.RawConfigParser()
|
config = configparser.RawConfigParser()
|
||||||
mongocnf = os.path.expanduser('~/.mongodb.cnf')
|
mongocnf = os.path.expanduser('~/.mongodb.cnf')
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@ -296,7 +296,7 @@ def load_mongocnf():
|
|||||||
user=config.get('client', 'user'),
|
user=config.get('client', 'user'),
|
||||||
password=config.get('client', 'pass')
|
password=config.get('client', 'pass')
|
||||||
)
|
)
|
||||||
except (ConfigParser.NoOptionError, IOError):
|
except (configparser.NoOptionError, IOError):
|
||||||
return False
|
return False
|
||||||
|
|
||||||
return creds
|
return creds
|
||||||
|
@ -18,7 +18,7 @@ cat << EOF > ansible.cfg
|
|||||||
[defaults]
|
[defaults]
|
||||||
pipelining = True
|
pipelining = True
|
||||||
strategy = mitogen_linear
|
strategy = mitogen_linear
|
||||||
strategy_plugins = /home/travis/virtualenv/python2.7.15/lib/python2.7/site-packages/ansible_mitogen/plugins/strategy
|
strategy_plugins = /home/travis/virtualenv/python3.6.9/lib/python3.6/site-packages/ansible_mitogen/plugins/strategy
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# Pull docker image or build it
|
# Pull docker image or build it
|
||||||
|
Loading…
x
Reference in New Issue
Block a user