mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-21 14:50:08 +03:00
feature #863: Moved fw driver to standard pre-post-clean plugins.
This commit is contained in:
parent
8117ca4b77
commit
22899b7139
@ -17,21 +17,11 @@
|
||||
#--------------------------------------------------------------------------- #
|
||||
|
||||
$: << File.dirname(__FILE__)
|
||||
$: << File.join(File.dirname(__FILE__), "..")
|
||||
|
||||
require 'base64'
|
||||
require 'OpenNebulaNetwork'
|
||||
require 'Firewall'
|
||||
|
||||
action = ARGV[0]
|
||||
template = ARGV[1]
|
||||
fw = OpenNebulaFirewall.from_base64(ARGV[0])
|
||||
|
||||
vm_xml = Base64::decode64(template)
|
||||
|
||||
fw = OpenNebulaFirewall.new(vm_xml)
|
||||
|
||||
case action
|
||||
when "on"
|
||||
fw.activate
|
||||
when "off"
|
||||
fw.deactivate
|
||||
end
|
||||
fw.deactivate
|
27
src/vnm_mad/remotes/fw/post
Executable file
27
src/vnm_mad/remotes/fw/post
Executable file
@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env ruby
|
||||
|
||||
# -------------------------------------------------------------------------- #
|
||||
# Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org) #
|
||||
# #
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
||||
# not use this file except in compliance with the License. You may obtain #
|
||||
# a copy of the License at #
|
||||
# #
|
||||
# http://www.apache.org/licenses/LICENSE-2.0 #
|
||||
# #
|
||||
# Unless required by applicable law or agreed to in writing, software #
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, #
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
|
||||
# See the License for the specific language governing permissions and #
|
||||
# limitations under the License. #
|
||||
#--------------------------------------------------------------------------- #
|
||||
|
||||
$: << File.dirname(__FILE__)
|
||||
$: << File.join(File.dirname(__FILE__), "..")
|
||||
|
||||
require 'OpenNebulaNetwork'
|
||||
require 'Firewall'
|
||||
|
||||
fw = OpenNebulaFirewall.from_base64(ARGV[0])
|
||||
|
||||
fw.activate
|
19
src/vnm_mad/remotes/fw/pre
Executable file
19
src/vnm_mad/remotes/fw/pre
Executable file
@ -0,0 +1,19 @@
|
||||
#!/bin/bash
|
||||
|
||||
# -------------------------------------------------------------------------- #
|
||||
# Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org) #
|
||||
# #
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
|
||||
# not use this file except in compliance with the License. You may obtain #
|
||||
# a copy of the License at #
|
||||
# #
|
||||
# http://www.apache.org/licenses/LICENSE-2.0 #
|
||||
# #
|
||||
# Unless required by applicable law or agreed to in writing, software #
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, #
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
|
||||
# See the License for the specific language governing permissions and #
|
||||
# limitations under the License. #
|
||||
#--------------------------------------------------------------------------- #
|
||||
|
||||
exit 0
|
Loading…
x
Reference in New Issue
Block a user