Hi,

Still I am getting the same error message.

On Sat, Sep 12, 2015 at 2:45 AM, Udara Liyanage <ud...@wso2.com> wrote:

> Hi,
>
> I found an error in my plugin, let me correct it and try again.
>
> On Sat, Sep 12, 2015 at 2:32 AM, Udara Liyanage <ud...@wso2.com> wrote:
>
>> Hi,
>>
>> I added attached plugin and and plugin definition. However below error is
>> shown in agent's log. Is it due to an error in plugin file or plugin
>> definition error?
>>
>> [2015-09-11 20:52:15,539] DEBUG {PluginFileLocator.py:locatePlugins} -
>> APICreationPlugin.py is not a valid plugin for strategy info_ext
>>
>>
>>
>> --
>>
>> Udara Liyanage
>> Software Engineer
>> WSO2, Inc.: http://wso2.com
>> lean. enterprise. middleware
>>
>> web: http://udaraliyanage.wordpress.com
>> phone: +94 71 443 6897
>>
>
>
>
> --
>
> Udara Liyanage
> Software Engineer
> WSO2, Inc.: http://wso2.com
> lean. enterprise. middleware
>
> web: http://udaraliyanage.wordpress.com
> phone: +94 71 443 6897
>



-- 

Udara Liyanage
Software Engineer
WSO2, Inc.: http://wso2.com
lean. enterprise. middleware

web: http://udaraliyanage.wordpress.com
phone: +94 71 443 6897
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you 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.

import mdsclient
from plugins.contracts import ICartridgeAgentPlugin
import time
import zipfile
import subprocess
from modules.util.log import LogFactory
import os


class APICreationPlugin(ICartridgeAgentPlugin):

    def run_plugin(self, values):
        log = LogFactory().get_log(__name__)
        log.info("Starting api creation plugin...")

        log.info("Reading port mappings...")
        port_mappings_str = values["PORT_MAPPINGS"]

        # port mappings format: """NAME:mgt-console|PROTOCOL:https|PORT:4500|PROXY_PORT:8443;
        #                          NAME:tomcat-http|PROTOCOL:http|PORT:4501|PROXY_PORT:7280;"""

        log.info("Port mappings: %s" % port_mappings_str)
        if port_mappings_str is not None:
	    port_entries=port_mappings_str.split(';')
	    for port_entry in port_entries:
	        if port_entry.startswith('NAME:http-5000'):
	    	    port_dict = dict(port_item.split(':') for port_item in port_entry.split('|'))
	    	    log.info(port_dict['PORT'])
	    	    break;

        log.info("API creation plugin completed")

Reply via email to