1
0
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:
Ruben S. Montero 2011-12-02 00:07:16 +01:00
parent 8117ca4b77
commit 22899b7139
4 changed files with 49 additions and 13 deletions

View File

@ -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
View 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
View 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