Jul-30-2018, 12:30 PM
(Jul-30-2018, 12:13 PM)sonicblind Wrote: If I would create my own class which would inherit from 'asm' class how would I attached this class to 'mgmt'?
You say you understand inheritance, yet, you want to modify the third-party package source?
If you inherit properly from Asm, your class will have all the functionality of the parent class, i.e. all the methods, properties, etc of Asm class. Of course without the one you override. I don't know what mgmt is or how Asm class is using it.
You show us how you want to change the __init__ method of the original code and I advise you not to mess with the original source, but inherit from it (of course you will need to properly use super() to initialize the parent - in your case Asm). If you override just the __init__ method (like you show in your original post) you will have all the functionality of Asm.
Also, assuming you write the violations policies and you will import it differently
How do you expect to be able to do this import
from f5.bigip.tm.asm.violations import Violations_s
when it does not exists?
If you can't explain it to a six year old, you don't understand it yourself, Albert Einstein
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs
How to Ask Questions The Smart Way: link and another link
Create MCV example
Debug small programs