Skip to content

Commit

Permalink
Don't set "config" and/or "device" properties when replacing profile
Browse files Browse the repository at this point in the history
  • Loading branch information
turtle0x1 committed May 31, 2022
1 parent 4dbf2c0 commit c2741b3
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All Notable changes to `php-lxd` will be documented in this file.

Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) principles.

# Unreleased

## Changed
Don't set "config" and/or "device" properties when replacing profile


# [0.22.0]

## Added
Expand Down
10 changes: 8 additions & 2 deletions src/Endpoint/Profiles.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,8 +155,14 @@ public function replace($name, $description = '', array $config = null, array $d
{
$profile = [];
$profile['description'] = $description;
$profile['config'] = $config;
$profile['devices'] = $devices;

if (!empty($config)) {
$profile['config'] = $config;
}

if (!empty($devices)) {
$profile['devices'] = $devices;
}

$config = [
"project"=>$this->client->getProject()
Expand Down

0 comments on commit c2741b3

Please sign in to comment.