Skip to content

Commit dfffd78

Browse files
committed
[spalenque] - #14274 * fix component category cron task
1 parent dcb231c commit dfffd78

1 file changed

Lines changed: 6 additions & 3 deletions

File tree

software/code/tasks/IngestOpenStackComponentsDataCronTask.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,9 @@ private function processComponentsAndCategories()
277277
if ($response->getStatusCode() == 200) {
278278
$files = json_decode($response->getBody());
279279
foreach ($files as $file) {
280+
$extension = pathinfo($file->name, PATHINFO_EXTENSION);
281+
if( !in_array($extension, ['yml','yaml']) ) continue;
282+
280283
// now read yaml file of parent category and extract subcategories and components
281284
echo sprintf("processing file %s ", $file->name).PHP_EOL;
282285
$yamlResponse = $this->client->get($file->download_url);
@@ -344,9 +347,9 @@ private function processComponentsAndCategories()
344347
}
345348

346349
$comp->Name = (isset($component['title'])) ? $component['title'] : '';
347-
$comp->CodeName = (isset($component['title'])) ? ucfirst($component['name']) : '';
348-
$comp->Description = (isset($component['title'])) ? $component['desc'] : '';
349-
$comp->Since = (isset($component['title'])) ? $component['since'] : '';
350+
$comp->CodeName = (isset($component['name'])) ? ucfirst($component['name']) : '';
351+
$comp->Description = (isset($component['desc'])) ? $component['desc'] : '';
352+
$comp->Since = (isset($component['since'])) ? $component['since'] : '';
350353

351354

352355
$comp->CategoryID = $subcat2->ID;

0 commit comments

Comments
 (0)