Skip to content
This repository has been archived by the owner on Nov 9, 2020. It is now read-only.

Commit

Permalink
Photon 2.0 Bug fix to properly identify VMware Photon OS.
Browse files Browse the repository at this point in the history
In the Photon 2.0 release, /etc/photon-release doesn't have 'VMware Photon Linux' anymore. It contains:

root@photon-2.0-ankurh [ ~ ]# cat /etc/photon-release
VMware Photon OS 2.0
PHOTON_BUILD_NUMBER=304b817

Fixing the code to grep for only VMware Photon instead of VMware Photon Linux.
  • Loading branch information
Ankur Huralikoppi committed May 10, 2018
1 parent 3c41310 commit 4e8bbed
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,22 @@ This is a [Vagrant](http://www.vagrantup.com/) [plugin](http://docs.vagrantup.co

## Installation

```
```shell
$ vagrant plugin install vagrant-guests-photon
```

## Development
To build and install the plugin directly from this repo:

```
```shell
$ bundle install
$ bundle rake build
$ bundle exec rake build
$ vagrant plugin install pkg/vagrant-guests-photon-1.0.2.gem
```

You can run RSpec with:

```
```shell
$ bundle install
$ bundle exec rake
```
2 changes: 1 addition & 1 deletion lib/vagrant-guests-photon/guest.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module VagrantPlugins
module GuestPhoton
class Guest < Vagrant.plugin('2', :guest)
def detect?(machine)
machine.communicate.test("cat /etc/photon-release | grep 'VMware Photon Linux'")
machine.communicate.test("grep 'VMware Photon' /etc/photon-release")
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/vagrant-guests-photon/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@
module VagrantPlugins
# Set version for vagrant-guests-photon gem.
module GuestPhoton
VERSION = '1.0.4'
VERSION = '1.0.5'
end
end
2 changes: 1 addition & 1 deletion spec/guest_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
include_context 'machine'

it 'should be detected with Photon' do
expect(communicate).to receive(:test).with("cat /etc/photon-release | grep 'VMware Photon Linux'")
expect(communicate).to receive(:test).with("grep 'VMware Photon' /etc/photon-release")
guest.detect?(machine)
end
end
2 changes: 1 addition & 1 deletion vagrant-guests-photon.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Gem::Specification.new do |s|
s.description = 'Enables Vagrant to manage VMware Photon machines.'

s.add_development_dependency 'bundler'
s.add_development_dependency 'rake'
s.add_development_dependency 'rake', '< 11.0'
s.add_development_dependency 'rspec-core', '~> 2.14'
s.add_development_dependency 'rspec-expectations', '~> 2.14'
s.add_development_dependency 'rspec-mocks', '~> 2.14'
Expand Down

0 comments on commit 4e8bbed

Please sign in to comment.