Skip to content
This repository has been archived by the owner on Mar 19, 2021. It is now read-only.

Commit

Permalink
Autochanger management: Label media improvement
Browse files Browse the repository at this point in the history
Adds the ability to label and assign media to all types of pools
and not just scratch pools.
  • Loading branch information
fbergkemper committed Aug 2, 2016
1 parent 03c291f commit 1f36e01
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Expand Up @@ -69,7 +69,7 @@ public function detailsAction()
}

try {
$pools = $this->getStorageModel()->getPools($this->bsock, 'scratch');
$pools = $this->getStorageModel()->getPools($this->bsock, null);
}
catch(Exception $e) {
echo $e->getMessage();
Expand Down
9 changes: 7 additions & 2 deletions module/Storage/src/Storage/Model/StorageModel.php
Expand Up @@ -167,8 +167,13 @@ public function label(&$bsock=null, $storage=null, $pool=null, $drive=null, $slo

public function getPools(&$bsock=null, $type=null)
{
if(isset($bsock, $type)) {
$cmd = '.pools type="'.$type.'"';
if(isset($bsock)) {
if($type == null) {
$cmd = '.pools';
}
else {
$cmd = '.pools type="'.$type.'"';
}
$pools = $bsock->send_command($cmd, 2, null);
$result = \Zend\Json\Json::decode($pools, \Zend\Json\Json::TYPE_ARRAY);
return $result['result']['pools'];
Expand Down

0 comments on commit 1f36e01

Please sign in to comment.