236
237
@patch.object(utils, 'git_src_dir')
237
238
@patch.object(utils, 'service_restart')
238
239
@patch.object(utils, 'render')
240
@patch.object(utils, 'git_pip_venv_dir')
239
241
@patch('os.path.join')
240
242
@patch('os.path.exists')
241
244
@patch('shutil.copytree')
242
245
@patch('shutil.rmtree')
243
def test_git_post_install(self, rmtree, copytree, exists, join, render,
244
service_restart, git_src_dir):
246
@patch('subprocess.check_call')
247
def test_git_post_install(self, check_call, rmtree, copytree, symlink,
248
exists, join, venv, render, service_restart,
245
250
projects_yaml = openstack_origin_git
246
251
join.return_value = 'joined-string'
252
venv.return_value = '/mnt/openstack-git/venv'
247
253
utils.git_post_install(projects_yaml)
249
255
call('joined-string', '/etc/glance'),
251
257
copytree.assert_has_calls(expected)
259
call('joined-string', '/usr/local/bin/glance-manage'),
261
symlink.assert_has_calls(expected, any_order=True)
252
262
glance_api_context = {
253
263
'service_description': 'Glance API server',
254
264
'service_name': 'Glance',
255
265
'user_name': 'glance',
256
266
'start_dir': '/var/lib/glance',
257
267
'process_name': 'glance-api',
258
'executable_name': '/usr/local/bin/glance-api',
268
'executable_name': 'joined-string',
259
269
'config_files': ['/etc/glance/glance-api.conf'],
260
270
'log_file': '/var/log/glance/api.log',
265
275
'user_name': 'glance',
266
276
'start_dir': '/var/lib/glance',
267
277
'process_name': 'glance-registry',
268
'executable_name': '/usr/local/bin/glance-registry',
278
'executable_name': 'joined-string',
269
279
'config_files': ['/etc/glance/glance-registry.conf'],
270
280
'log_file': '/var/log/glance/registry.log',