Skip to content

Commit

Permalink
Forcibly mark vCloud VMs as not disconnected
Browse files Browse the repository at this point in the history
Like other cloud providers we have to override functions

```
def disconnected
def disconnected?
```

to always return false for vCloud cloud provider or else UI
displays all its VMs as 'disconnected' regardless the actual
power state.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1649403
Fixes ManageIQ/manageiq-ui-classic#4909

Signed-off-by: Miha Pleško <[email protected]>
  • Loading branch information
miha-plesko committed Nov 19, 2018
1 parent 90b7efc commit bb76c59
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
8 changes: 8 additions & 0 deletions app/models/manageiq/providers/vmware/cloud_manager/vm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,14 @@ def provider_object(connection = nil)
"suspended" => "suspended"
}.freeze

def disconnected
false
end

def disconnected?
false
end

def self.calculate_power_state(raw_power_state)
# https://github.com/xlab-si/fog-vcloud-director/blob/master/lib/fog/vcloud_director/parsers/compute/vm.rb#L70
POWER_STATES[raw_power_state.to_s] || "terminated"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,5 +83,13 @@
vm.raw_suspend
end
end

it '.disconnected' do
expect(subject.disconnected).to be_falsey
end

it '.disconnected?' do
expect(subject.disconnected).to be_falsey
end
end
end

0 comments on commit bb76c59

Please sign in to comment.