/** * @param $formData * @param string $entryPoint * @return bool */ function tryReleaseSubmit( $formData, $entryPoint = 'internal' ) { $ip = $formData['ip']; #TODO: Instead of throwing an error when host exist or the IP # is associated, remove all host entries and disassociate the IP # then release the address $outputPage = $this->getOutput(); $hosts = OpenStackNovaHost::getHostsByIP( $ip ); if ( $hosts ) { $outputPage->addWikiMsg( 'openstackmanager-cannotreleaseaddress', $ip ); return true; } $address = $this->adminNova->getAddress( $ip ); if ( $address->getInstanceId() ) { $outputPage->addWikiMsg( 'openstackmanager-cannotreleaseaddress', $ip ); return true; } $success = $this->userNova->releaseAddress( $ip ); if ( $success ) { $outputPage->addWikiMsg( 'openstackmanager-releasedaddress', $ip ); } else { $outputPage->addWikiMsg( 'openstackmanager-cannotreleaseaddress', $ip ); } $out = '<br />'; $out .= Linker::link( $this->getTitle(), wfMsgHtml( 'openstackmanager-backaddresslist' ) ); $outputPage->addHTML( $out ); return true; }