Skip to content

Commit

Permalink
Correct proxmox api credential parsing #1571
Browse files Browse the repository at this point in the history
not sure if this is a php8 thing or if composer updated the plugin but the proxmox credentials weren't creating an object and so it wouldn't connect to proxmox any longer.  after a little debugging I just needed to move the parameters into an array and then pass that to the constructor and it was happy again
  • Loading branch information
wilpig committed Oct 25, 2024
1 parent c16c3c3 commit e74f879
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions classes/PMox.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,16 @@ static function EnumerateVMs($d,$debug=false){
$vmList=array();

// Establish credentials for this particular device

$credentials = new Credentials( $d->PrimaryIP,
$d->APIUsername,
$d->APIPassword,
$d->ProxMoxRealm,
$d->APIPort );
$credentials = [
'hostname' => $d->PrimaryIP,
'username' => $d->APIUsername,
'password' => $d->APIPassword,
'realm' => $d->ProxMoxRealm,
'port' => $d->APIPort,
];

// Turn credentials array into an object
$credentials = new Credentials($credentials);

try {
$proxmox = new Proxmox($credentials);
Expand Down

0 comments on commit e74f879

Please sign in to comment.