-
Notifications
You must be signed in to change notification settings - Fork 240
fix(broker): fix wizard broker configuration with one peer retention #6959
Conversation
a7442a0
to
b192b2b
Compare
2713890
to
a90c1fa
Compare
use Centreon\Domain\Repository\Interfaces\CfgCentreonBrokerInterface; | ||
use Centreon\Infrastructure\Service\Exception\NotFoundException; | ||
|
||
class CfgCentreonBrokerRepository extends ServiceEntityRepository implements CfgCentreonBrokerInterface |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add comment for this class header
return $result; | ||
} | ||
|
||
public function truncate() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add comments to explain which tables are affected
|
||
echo "{$datetime} - Checking for pending export tasks: " . count($tasks) . " task(s) found\n"; | ||
|
||
foreach ($tasks as $x => $task) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you don't use keys in foreach use array_values($tasks) as $task
instead
try { | ||
$this->getDi()['centreon_remote.export']->export($commitment); | ||
} catch (\Exception $e) { | ||
echo $e->__toString() . "\n"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will show the stack trace also, is it expected?
|
||
echo "{$datetime} - Checking for pending import tasks: " . count($tasks) . " task(s) found\n"; | ||
|
||
foreach ($tasks as $x => $task) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you don't use keys in foreach use array_values($tasks) as $task
instead
$data, | ||
'ns_nagios_server', | ||
'CentreonRemote\Domain\Resources\DefaultConfig\CfgCentreonBroker' | ||
); | ||
} | ||
|
||
public function setCfgCentreonBrokerInfo(array $data) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add comments in the header of this method.
@@ -148,13 +186,13 @@ public function getStatusByParent(int $parentId) | |||
*/ | |||
public function updateStatus(string $taskId, string $status) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't forget to explain the returned array structure.
When the returned value may not have the same structure, you can use this annotation @return type1 | type2
@@ -17,7 +17,7 @@ public function requestConfigurationIsPoller() | |||
return !static::requestConfigurationIsRemote(); | |||
} | |||
|
|||
public function fetchIfServerInstalledBam($ip, $centreonPath) | |||
public function checkBamOnRemoteServer($ip, $centreonPath) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't forget to add comments in the header of this method.
@@ -42,8 +42,14 @@ | |||
* @param string $path | |||
* @param array $exporters | |||
*/ | |||
public function __construct(int $remote = null, array $pollers = null, array $meta = null, ExportParserInterface $parser = null, string $path = null, array $exporters = null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't forget to explain parameters
|
||
class CfgCentreonBrokerInfo | ||
{ | ||
public static function getConfiguration() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't forget to describe the returned array structure
9798dc9
to
b8bb937
Compare
1cfb343
to
567ef3f
Compare
* fix(remote-server): Update authorizedMaster value using enableRemote * enh(remote-server): authorize multiple master
…6959) * fix(broker): fix wizard broker configuration with one peer retention mode * enh(broker): add poller name in one peer retention configuration name Refs: #6910 #6978 #6987 * add comments * fix broker configuration methods * Remote server add multiple authorized master (#7063) * fix(remote-server): Update authorizedMaster value using enableRemote * enh(remote-server): authorize multiple master * fix syntax error * improve centcore debug * fix bam broker configuration on remote server * test(ut): fix unit tests of remote server * test(ut): update value of mocked constants
…6959) * fix(broker): fix wizard broker configuration with one peer retention mode * enh(broker): add poller name in one peer retention configuration name Refs: #6910 #6978 #6987 * add comments * fix broker configuration methods * Remote server add multiple authorized master (#7063) * fix(remote-server): Update authorizedMaster value using enableRemote * enh(remote-server): authorize multiple master * fix syntax error * improve centcore debug * fix bam broker configuration on remote server * test(ut): fix unit tests of remote server * test(ut): update value of mocked constants
Refs : #6910 #6978 #6987