Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[inventory] Warning with host without configuration #1583

Closed
sanpii opened this issue Apr 9, 2018 · 1 comment
Closed

[inventory] Warning with host without configuration #1583

sanpii opened this issue Apr 9, 2018 · 1 comment
Labels
Milestone

Comments

@sanpii
Copy link

sanpii commented Apr 9, 2018

Q A
Issue Type Bug
Deployer Version v6.1.0
Local Machine OS Linux
Remote Machine OS Linux

Description

After reading the code FileLoader::load(), I think this second foreach seems duplicated.

Steps to reproduce

Content of deploy.php

<?php declare(strict_types = 1);

namespace Deployer;

require 'recipe/common.php';

inventory('hosts.yml');

And a hosts.yml file contening:

host: ~

Output log

$ ./bin/dep config:hosts -vvv                                                                                               
PHP Warning:  Invalid argument supplied for foreach() in /home/sanpi/projects/vendor/deployer/deployer/src/Host/FileLoader.php on line 65                
PHP Stack trace:
PHP   1. {main}() /home/sanpi/projects/vendor/deployer/deployer/bin/dep:0
PHP   2. Deployer\Deployer::run() /home/sanpi/projects/vendor/deployer/deployer/bin/dep:120
PHP   3. call_user_func:{/home/sanpi/projects/vendor/deployer/deployer/src/Deployer.php:326}() /home/sanpi/projects/vendor/deployer/deployer/src/Deployer.php:326
PHP   4. Deployer\Deployer::Deployer\{closure}() /home/sanpi/projects/vendor/deployer/deployer/src/Deployer.php:326
PHP   5. require() /home/sanpi/projects/vendor/deployer/deployer/src/Deployer.php:325
PHP   6. Deployer\inventory() /home/sanpi/projects/deploy.php:7
PHP   7. Deployer\Host\FileLoader->load() /home/sanpi/projects/vendor/deployer/deployer/src/functions.php:101
➤ Executing task config:hosts                                                                                                                                         
+------+----------+-------+-------+-------------+                                                                                                                     
| Host | Hostname | Stage | Roles | Deploy path |                                                                                                                     
+------+----------+-------+-------+-------------+                                                                                                                     
| host | host     |       |       |             |                                                                                                                     
+------+----------+-------+-------+-------------+
• done on [host]                                                                                                                                                      
✔ Ok [2ms]                                         
@antonmedv antonmedv added this to the 6.1 milestone Apr 10, 2018
@antonmedv
Copy link
Member

Fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants