[pve-devel] [RFC ha-manager 3/8] Env: add method to get hardware object

Thomas Lamprecht t.lamprecht at proxmox.com
Fri Jan 22 17:06:37 CET 2016


Signed-off-by: Thomas Lamprecht <t.lamprecht at proxmox.com>
---
 src/PVE/HA/Env.pm      | 6 ++++++
 src/PVE/HA/Env/PVE2.pm | 6 ++++++
 src/PVE/HA/Sim/Env.pm  | 6 ++++++
 3 files changed, 18 insertions(+)

diff --git a/src/PVE/HA/Env.pm b/src/PVE/HA/Env.pm
index 82ba497..5442e7e 100644
--- a/src/PVE/HA/Env.pm
+++ b/src/PVE/HA/Env.pm
@@ -26,6 +26,12 @@ sub nodename {
     return $self->{plug}->nodename();
 }
 
+sub hardware {
+    my ($self) = @_;
+
+    return $self->{plug}->hardware();
+}
+
 # manager status is stored on cluster, protected by ha_manager_lock
 sub read_manager_status {
     my ($self) = @_;
diff --git a/src/PVE/HA/Env/PVE2.pm b/src/PVE/HA/Env/PVE2.pm
index c8bf3e6..8a8fe84 100644
--- a/src/PVE/HA/Env/PVE2.pm
+++ b/src/PVE/HA/Env/PVE2.pm
@@ -39,6 +39,12 @@ sub nodename {
     return $self->{nodename};
 }
 
+sub hardware {
+    my ($self) = @_;
+
+    die "hardware is for testing and simulation only";
+}
+
 sub read_manager_status {
     my ($self) = @_;
 
diff --git a/src/PVE/HA/Sim/Env.pm b/src/PVE/HA/Sim/Env.pm
index 20d0de5..6fa789d 100644
--- a/src/PVE/HA/Sim/Env.pm
+++ b/src/PVE/HA/Sim/Env.pm
@@ -38,6 +38,12 @@ sub nodename {
     return $self->{nodename};
 }
 
+sub hardware {
+    my ($self) = @_;
+
+    return $self->{hardware};
+}
+
 sub sim_get_lock {
     my ($self, $lock_name, $unlock) = @_;
 
-- 
2.1.4





More information about the pve-devel mailing list