From: Alfredo Deza Date: Mon, 3 Mar 2014 21:55:07 +0000 (-0500) Subject: fix conf changes for test_cli_new X-Git-Tag: v1.4.0~8^2~7 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=0fa6815277ffe5aaf2288385457a201760788d7b;p=ceph-deploy.git fix conf changes for test_cli_new Signed-off-by: Alfredo Deza --- diff --git a/ceph_deploy/tests/test_cli_new.py b/ceph_deploy/tests/test_cli_new.py index 8f6cda8..4c7a10d 100644 --- a/ceph_deploy/tests/test_cli_new.py +++ b/ceph_deploy/tests/test_cli_new.py @@ -1,4 +1,3 @@ -import pytest from mock import patch import re import subprocess @@ -22,12 +21,12 @@ def test_help(tmpdir, cli): def test_write_global_conf_section(tmpdir, cli): - with patch('ceph_deploy.new.socket.gethostbyname'): - with patch('ceph_deploy.new.socket.getaddrinfo', fake_getaddrinfo): + with patch('ceph_deploy.new.net.get_nonlocal_ip', lambda x: '10.0.0.1'): + with patch('ceph_deploy.new.arg_validators.Hostname', lambda: lambda x: x): with directory(str(tmpdir)): main(args=['new', 'host1']) with tmpdir.join('ceph.conf').open() as f: - cfg = conf.parse(f) + cfg = conf.ceph.parse(f) assert cfg.sections() == ['global'] @@ -36,12 +35,12 @@ def pytest_funcarg__newcfg(request): cli = request.getfuncargvalue('cli') def new(*args): - with patch('ceph_deploy.new.socket.gethostbyname'): - with patch('ceph_deploy.new.socket.getaddrinfo', fake_getaddrinfo): + with patch('ceph_deploy.new.net.get_nonlocal_ip', lambda x: '10.0.0.1'): + with patch('ceph_deploy.new.arg_validators.Hostname', lambda: lambda x: x): with directory(str(tmpdir)): main( args=['new'] + list(args)) with tmpdir.join('ceph.conf').open() as f: - cfg = conf.parse(f) + cfg = conf.ceph.parse(f) return cfg return new