Skip to content

Commit c2741b3

Browse files
committed
Don't set "config" and/or "device" properties when replacing profile
1 parent 4dbf2c0 commit c2741b3

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,12 @@ All Notable changes to `php-lxd` will be documented in this file.
44

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

7+
# Unreleased
8+
9+
## Changed
10+
Don't set "config" and/or "device" properties when replacing profile
11+
12+
713
# [0.22.0]
814

915
## Added

src/Endpoint/Profiles.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,8 +155,14 @@ public function replace($name, $description = '', array $config = null, array $d
155155
{
156156
$profile = [];
157157
$profile['description'] = $description;
158-
$profile['config'] = $config;
159-
$profile['devices'] = $devices;
158+
159+
if (!empty($config)) {
160+
$profile['config'] = $config;
161+
}
162+
163+
if (!empty($devices)) {
164+
$profile['devices'] = $devices;
165+
}
160166

161167
$config = [
162168
"project"=>$this->client->getProject()

0 commit comments

Comments
 (0)