Skip to content
This repository was archived by the owner on Sep 19, 2022. It is now read-only.

Commit 147c32f

Browse files
committed
Fixed works with internal attr name in MetadataToPerun/MetadataFromPerun (#135)
1 parent 32868de commit 147c32f

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
All notable changes to this project will be documented in this file.
33

44
## [Unreleased]
5+
#### Fixed
6+
- Fixed works with internal attr name in MetadataToPerun/MetadataFromPerun
57

68
## [v4.0.2]
79
#### Fixed

lib/MetadataFromPerun.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -172,14 +172,15 @@ private function getAllAttributeNames()
172172
private function getFacilities()
173173
{
174174
$perunProxyIdentifierAttr = $this->conf->getString(self::PERUN_PROXY_IDENTIFIER_ATTR_NAME);
175+
$perunProxyIdentifierRpcAttrName = AttributeUtils::getRpcAttrName($perunProxyIdentifierAttr);
175176
$proxyIdentifier = $this->conf->getString(self::PROXY_IDENTIFIER);
176177
$attributeDefinition = [
177-
$perunProxyIdentifierAttr => $proxyIdentifier,
178+
$perunProxyIdentifierRpcAttrName => $proxyIdentifier,
178179
];
179180
return $this->rpcAdapter->searchFacilitiesByAttributeValue($attributeDefinition);
180181
}
181182

182-
/**
183+
/**+
183184
* Get facilities with attributes.
184185
*/
185186
private function getFacilitiesWithAttributes()

lib/MetadataToPerun.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,12 +272,13 @@ private function addXmlAttributes($metadata, &$facility)
272272

273273
private function getAttributesDefinition(array $attrNames)
274274
{
275+
$perunAttrNames = AttributeUtils::getAttrNames($attrNames, AttributeUtils::RPC);
275276
return array_values(
276277
array_filter(
277278
$this->adapter->getAttributesDefinition(),
278-
function ($attr) use ($attrNames) {
279+
function ($attr) use ($perunAttrNames) {
279280
$perunName = $attr['namespace'] . self::NAMESPACE_SEPARATOR . $attr['friendlyName'];
280-
return in_array($perunName, $attrNames, true);
281+
return in_array($perunName, $perunAttrNames, true);
281282
}
282283
)
283284
);

0 commit comments

Comments
 (0)