Don't make a copy of master node logs
Master node host creds are injected into shotgun config making it connect to localhost via ssh and make a copy of logs in /var/dump. Without creds, which aren't necessary anymore since we don't use containers, it just makes a symlink saving a lot of space. Also fixes incorrect excludes. Change-Id: I2e1a60bd71955b2c607f46d2cde60daa49811be7 Partial-Bug: #1543491
This commit is contained in:
parent
1ce23a0f22
commit
410e0b9c23
|
@ -858,8 +858,8 @@ DUMP:
|
|||
- type: dir
|
||||
path: /var/log
|
||||
exclude:
|
||||
- atop/
|
||||
- dump/
|
||||
- atop
|
||||
- dump
|
||||
- type: file
|
||||
path: /var/log/atop/atop_current
|
||||
- type: command
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
import collections
|
||||
from copy import deepcopy
|
||||
import os
|
||||
import socket
|
||||
|
||||
import netaddr
|
||||
import six
|
||||
|
@ -1755,13 +1754,6 @@ class DumpTask(object):
|
|||
'to_file': 'cobbler.txt',
|
||||
})
|
||||
|
||||
# inject master host
|
||||
dump_conf['dump']['master']['hosts'] = [{
|
||||
'hostname': socket.gethostname(),
|
||||
'address': settings.MASTER_IP,
|
||||
'ssh-key': settings.SHOTGUN_SSH_KEY,
|
||||
}]
|
||||
|
||||
logger.debug("Dump conf: %s", str(dump_conf))
|
||||
return dump_conf
|
||||
|
||||
|
|
|
@ -36,17 +36,6 @@ class TestSnapshotConf(base.TestCase):
|
|||
# real localhost and there's only one host
|
||||
self.assertFalse(len(conf['dump']['local']['hosts']))
|
||||
|
||||
@mock.patch('nailgun.task.task.socket')
|
||||
def test_master_injection(self, mock_socket):
|
||||
hostname = 'test-hostname-test'
|
||||
mock_socket.gethostname.return_value = hostname
|
||||
conf = task.DumpTask.conf()
|
||||
self.assertEqual(conf['dump']['master']['hosts'][0], {
|
||||
'hostname': hostname,
|
||||
'address': settings.MASTER_IP,
|
||||
'ssh-key': settings.SHOTGUN_SSH_KEY,
|
||||
})
|
||||
|
||||
def test_postgres_injection(self):
|
||||
conf = task.DumpTask.conf()
|
||||
|
||||
|
|
Loading…
Reference in New Issue