Skip to content

Commit

Permalink
Merge pull request #1413 from fagai/fix-inventory
Browse files Browse the repository at this point in the history
Fix inventory method
  • Loading branch information
antonmedv committed Nov 9, 2017
2 parents 2727b93 + 2cd8c3f commit bab76a1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

### Fixed
- Fixed bug when config:hosts shows more than one table of hosts [#1403]
- Fixed bug that inventory method does not return Proxy [#1413]

## v6.0.3
[v6.0.2...v6.0.3](https://github.com/deployphp/deployer/compare/v6.0.2...v6.0.3)
Expand Down Expand Up @@ -317,6 +318,7 @@
- Fixed typo3 recipe
- Fixed remove of shared dir on first deploy

[#1413]: https://github.com/deployphp/deployer/pull/1413
[#1403]: https://github.com/deployphp/deployer/pull/1403
[#1390]: https://github.com/deployphp/deployer/pull/1390
[#1365]: https://github.com/deployphp/deployer/pull/1365
Expand Down
6 changes: 5 additions & 1 deletion src/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -91,16 +91,20 @@ function localhost(...$hostnames)
* Load list of hosts from file
*
* @param string $file
* @return Proxy
*/
function inventory($file)
{
$deployer = Deployer::get();
$fileLoader = new FileLoader();
$fileLoader->load($file);

foreach ($fileLoader->getHosts() as $host) {
$hosts = $fileLoader->getHosts();
foreach ($hosts as $host) {
$deployer->hosts->set($host->getHostname(), $host);
}

return new Proxy($hosts);
}

/**
Expand Down

0 comments on commit bab76a1

Please sign in to comment.