Skip to content

Commit b6c6b7f

Browse files
committed
FIXUP and REWRITE: Comment out unused and unreachable code
1 parent 9f0aa3f commit b6c6b7f

7 files changed

Lines changed: 2 additions & 71 deletions

File tree

library/Vspheredb/DbObject/DistributedVirtualSwitch.php

Lines changed: 0 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -51,19 +51,6 @@ public function setUplinkPortGroups(array $portGroups): void
5151
var_dump($portGroups);
5252
}
5353

54-
/**
55-
* @param array $portGroups
56-
*
57-
* @return void
58-
*/
59-
public function XXXXsetPortGroups(array $portGroups): void
60-
{
61-
$newSum = $this->calculateMorefsChecksum($portGroups);
62-
if ($this->get('portgroups_checksum') !== $newSum) {
63-
$this->scheduleNewPortgroupRefs($portGroups);
64-
}
65-
}
66-
6754
/**
6855
* @param ManagedObjectReference[] $hostMembers
6956
*
@@ -73,13 +60,6 @@ public function setHostMembers(array $hostMembers): void
7360
{
7461
var_dump('HOSTMEMBERS');
7562
var_dump($hostMembers);
76-
77-
// return;
78-
//
79-
// $newSum = $this->calculateMorefsChecksum($hostMembers);
80-
// if ($this->get('hostmembers_checksum') !== $newSum) {
81-
// $this->scheduleNewPortgroupRefs($hostMembers);
82-
// }
8363
}
8464

8565
/**
@@ -92,17 +72,6 @@ protected function scheduleNewPortgroupRefs(array $portGroups): void
9272
$this->unstoredPortGroupRefs = $portGroups;
9373
}
9474

95-
protected function onStore(): void
96-
{
97-
// if (false && $this->unstoredPortGroupRefs) {
98-
// $this->replaceMoRefs(
99-
// $this->get('uuid'),
100-
// 'distributed_switch_portgroup',
101-
// $this->unstoredPortGroupRefs
102-
// );
103-
// }
104-
}
105-
10675
/**
10776
* @param string $uuid
10877
* @param string $table

library/Vspheredb/PerformanceData/IcingaRrd/RrdImg.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ protected static function prepareImg(string $moref, string $device, string $temp
7676
$width = 340;
7777
$height = 180;
7878
$end = floor(time() / 300) * 300;
79-
// $start = $end - 86400;
8079
$start = $end - 14400;
8180
$params = [
8281
'file' => sprintf('%s/%s.rrd', $moref, $device),

library/Vspheredb/Polling/CurlOptions.php

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,24 +23,12 @@ public static function forServerInfo(ServerInfo $server): array
2323
{
2424
$host = $server->get('host');
2525
if (preg_match('/^(.+?):(\d{1,5})$/', $host, $match)) {
26-
// $host = $match[1];
2726
$port = (int) $match[2];
2827
} else {
2928
$port = null;
3029
}
31-
$options = [
32-
CURLOPT_HTTPHEADER => [
33-
// Host header disabled for now, see #496
34-
// "Host: $host",
35-
'Expect:',
36-
'User-Agent: Icinga-vSphereDB/1.8'
37-
]
38-
];
39-
40-
// Unused, we're authenticating via SOAP
41-
// if (null !== ($username = $server->get('username'))) {
42-
// $options[CURLOPT_USERPWD] = sprintf('%s:%s', $username, $server->get('password'));
43-
// }
30+
$options = [CURLOPT_HTTPHEADER => ['Expect:', 'User-Agent: Icinga-vSphereDB/1.8']];
31+
$options[CURLOPT_HTTPHEADER] = ['Expect:', 'User-Agent: Icinga-vSphereDB/1.8'];
4432

4533
if ($proxyType = $server->get('proxy_type')) {
4634
// TODO: Depending on the PHP and Curl version, we might want to support HTTPS proxies

library/Vspheredb/Web/OverviewTree.php

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,6 @@ protected function getTree(): array
5555
$tree = [];
5656
$all = [];
5757
foreach ($this->fetchTree() as $item) {
58-
// if (
59-
// $this->typeFilter
60-
// && (string) $item->parent_object_type === 'Datacenter'
61-
// && $item->object_name !== $this->typeFilter
62-
// ) {
63-
// continue; // see #260
64-
// }
6558
$item->children = [];
6659

6760
/** @var string $uuid */

library/Vspheredb/Web/Widget/CalendarMonthSummary.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,6 @@ protected function weekRow($cw): HtmlElement
212212
protected function getMonthName(): string
213213
{
214214
return $this->timeFormat->getMonthName($this->getMonthAsTimestamp());
215-
// return date('F', $this->getMonthAsTimestamp());
216215
}
217216

218217
protected function createWeekdayHeader(): HtmlElement

library/Vspheredb/Web/Widget/CpuAbsoluteUsage.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ public function __construct(int $mhz, ?int $cores = null, int $perCore = 2000)
2020
{
2121
$class = null;
2222
if ($cores !== null) {
23-
// if (false) {
24-
// $this->add(Html::tag('span', ['class' => 'cpu-count'], sprintf($this->translate('%d CPUs'), $cores)));
25-
// }
2623
$usedPerCore = $mhz / $cores;
2724
if ($usedPerCore / $perCore > 0.7) {
2825
$class = 'critical';

library/Vspheredb/Web/Widget/VmHardwareTree.php

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -138,13 +138,6 @@ protected function renderDisk(object $disk, object $device, object $controller):
138138
$result[] = Format::bytes($disk->capacity);
139139
}
140140

141-
// if (false && array_key_exists($scsi, $this->diskPerf)) {
142-
// $result[] = new CompactInOutSparkline(
143-
// $this->diskPerf[$scsi][171],
144-
// $this->diskPerf[$scsi][172]
145-
// );
146-
// }
147-
148141
return $result;
149142
}
150143

@@ -186,13 +179,6 @@ protected function linkToPortGroup($uuid): string
186179
}
187180

188181
return sprintf('%s (%d NICs)', $info->object_name, $info->cnt_nics);
189-
190-
// TODO:
191-
// return Link::create(
192-
// sprintf('%s (%d NICs)', $info->object_name, $info->cnt_nics),
193-
// 'vspheredb/portgroup',
194-
// Util::uuidParams($info->uuid)
195-
// );
196182
}
197183

198184
protected function fetchDiskPerf(): array

0 commit comments

Comments
 (0)