Skip navigation
2057 Views 6 Replies Latest reply: Jul 26, 2012 11:08 AM by Shane Scott RSS
Andrey Telepin Rank: White Belt 70 posts since
May 13, 2010
Currently Being Moderated

Jul 3, 2012 5:20 AM

Changing "factory_type_information" on fly

I need add new item to "Display:" drop down menu when new component added to IpInterface. In modeling time i create new object which belong to interface, and transfer to constructor two parametrs first parent object "IpInteface" in my case second ObjMap.  For few interfaces its work, i see new field, and get action as i want, but for another i see all log statment but no effect. Any Ideas?

 

My class

 

class cbServicePolicy(cbPolicyMap):

.......

         

  SPPerf = {'id'            : 'perfServer',

                              'name'          : 'Service Policy Graphs',

                              'action'        : 'viewServicePolicyPerformance',

                              'permissions'   : (ZEN_VIEW, )

                             }

 

 

   def __init__(self, pcomp, objmap):

           """

          Init

          """

                id = dict(objmap.items())['fid']

                cbPolicyMap.__init__(self, id)

  

                factory_type_information = pcomp.factory_type_information

                actions = list(factory_type_information[0]['actions'])

                log.warn("init pcomp %s, actions = %s", pcomp, actions)

                if  self.SPPerf not in actions:

                       actions.append(self.SPPerf)

                       factory_type_information[0]['actions'] = tuple(actions)

                       pcomp.factory_type_information = factory_type_information

                       log.warn("apply changes to interface %s", pcomp.viewName())

                   pcomp._p_changed = True

  • Shane Scott ZenossMaster 1,373 posts since
    Jul 6, 2009
    Currently Being Moderated
    1. Jul 6, 2012 5:02 PM (in response to Andrey Telepin)
    Re: Changing "factory_type_information" on fly

    Andrey:

     

    I don't understand. Can you elaborate?

     

    --Shane (Hackman238)

  • Shane Scott ZenossMaster 1,373 posts since
    Jul 6, 2009
    Currently Being Moderated
    3. Jul 9, 2012 6:49 AM (in response to Andrey Telepin)
    Re: Changing "factory_type_information" on fly

    Andrey:

     

    This is very interesting. I'm very interested to know if you're willing to share a copy of your pack that does this- I've never seen this functionality before. Can you post or PM me a copy?

     

    --Shane (Hackman238)

  • Shane Scott ZenossMaster 1,373 posts since
    Jul 6, 2009
    Currently Being Moderated
    6. Jul 26, 2012 11:08 AM (in response to Andrey Telepin)
    Re: Changing "factory_type_information" on fly

    Andrey:

     

    I appreciate it.

     

    Best,

    --Shane (Hackman238)

More Like This

  • Retrieving data ...

Legend

  • Correct Answers - 4 points
  • Helpful Answers - 2 points