Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

fix(broker): fix wizard broker configuration with one peer retention #6959

Merged
merged 10 commits into from
Jan 14, 2019

Conversation

kduret
Copy link
Contributor

@kduret kduret commented Nov 8, 2018

Refs : #6910 #6978 #6987

@sc979 sc979 requested review from v-radev, callapa and victorvassilev and removed request for v-radev November 8, 2018 15:53
@kduret kduret force-pushed the MON-3171-fix-wizard-one-peer-retention branch 2 times, most recently from a7442a0 to b192b2b Compare November 29, 2018 16:32
@kduret kduret force-pushed the MON-3171-fix-wizard-one-peer-retention branch from 2713890 to a90c1fa Compare December 4, 2018 16:08
use Centreon\Domain\Repository\Interfaces\CfgCentreonBrokerInterface;
use Centreon\Infrastructure\Service\Exception\NotFoundException;

class CfgCentreonBrokerRepository extends ServiceEntityRepository implements CfgCentreonBrokerInterface
Copy link
Contributor

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()
Copy link
Contributor

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) {
Copy link
Contributor

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";
Copy link
Contributor

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) {
Copy link
Contributor

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)
Copy link
Contributor

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)
Copy link
Contributor

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)
Copy link
Contributor

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)
Copy link
Contributor

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()
Copy link
Contributor

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

@kduret kduret force-pushed the MON-3171-fix-wizard-one-peer-retention branch from 9798dc9 to b8bb937 Compare December 6, 2018 15:37
@kduret kduret force-pushed the MON-3171-fix-wizard-one-peer-retention branch 2 times, most recently from 1cfb343 to 567ef3f Compare December 31, 2018 10:24
@kduret kduret merged commit ebe36ac into master Jan 14, 2019
@kduret kduret deleted the MON-3171-fix-wizard-one-peer-retention branch January 14, 2019 17:29
vhr pushed a commit that referenced this pull request Jan 22, 2019
…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
vhr pushed a commit that referenced this pull request Jan 23, 2019
…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
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants