> wrote:
>>
>> I was just "concerned" that those who have their own Marvin tests that are
>> not checked in might be broken if I don't keep the class method.
>> ________
>> From: Will Stevens <williamstev...@gmail.com
ect from the applicable UUID and then invoke the method on
> it).
>
> That being the case, I think we should just keep the class methods.
>
> From: Will Stevens <williamstev...@gmail.com>
> Sent: Sunday, May 1, 2016 12:15 PM
> To: dev@cloudstack.apa
on it).
That being the case, I think we should just keep the class methods.
From: Will Stevens <williamstev...@gmail.com>
Sent: Sunday, May 1, 2016 12:15 PM
To: dev@cloudstack.apache.org
Subject: Re: Python Question (with regards to Marvin)
Ya. Let's see how pre
ed in might be broken if I don't keep the class method.
>
> From: Will Stevens <williamstev...@gmail.com>
> Sent: Sunday, May 1, 2016 12:03 PM
> To: dev@cloudstack.apache.org
> Subject: Re: Python Question (with regards to Marvin)
>
stack.apache.org
Subject: Re: Python Question (with regards to Marvin)
It will be easy to grep if there class methods, so we should start there.
If not, then I agree that an instance method is probably the best way to
go.
On May 1, 2016 12:41 PM, "Tutkowski, Mike" <mike.tutkow...@netapp
__
> From: Tutkowski, Mike <mike.tutkow...@netapp.com>
> Sent: Sunday, May 1, 2016 10:18 AM
> To: dev@cloudstack.apache.org
> Subject: Re: Python Question (with regards to Marvin)
>
> The question then becomes, do we want to keep the instance or the class
> method?
).
From: Tutkowski, Mike <mike.tutkow...@netapp.com>
Sent: Sunday, May 1, 2016 10:18 AM
To: dev@cloudstack.apache.org
Subject: Re: Python Question (with regards to Marvin)
The question then becomes, do we want to keep the instance or the class method?
There
@classmethod
>>def run(cls):
>>print "class hi"
>>
>> # test = Test()
>>
>> Test.run()
>>
>> What gets printed:
>> class hi
>>
>> class Test:
>>def run(self):
>>print "instance
t;
> What gets printed:
> class hi
>
> class Test:
> def run(self):
> print "instance hi"
>
> @classmethod
> def run(cls):
> print "class hi"
>
> # test = Test()
>
> Test.run()
>
> What gets printed:
&
quot;class hi"
# test = Test()
Test.run()
What gets printed:
class hi
class Test:
@classmethod
def run(cls):
print "class hi"
# test = Test()
Test.run()
What gets printed:
class hi
From: Tutkowski, Mike
Sent: Saturday, April 30, 201
hi'
>> 5
>> 6 def run(self):
>> 7 print 'instance hi'
>> 8
>> 9 test = Test()
>> 10
>> 11 test.run()
>>
>> As I suspected, I think this means we have a problem in base.py.
>>
n(self):
> 7 print 'instance hi'
> 8
> 9 test = Test()
> 10
> 11 test.run()
>
> As I suspected, I think this means we have a problem in base.py.
>
> From: Will Stevens <williamstev...@gmail.com>
> Sent: Saturday
suspected, I think this means we have a problem in base.py.
From: Will Stevens <williamstev...@gmail.com>
Sent: Saturday, April 30, 2016 1:46 PM
To: dev@cloudstack.apache.org
Subject: Re: Python Question (with regards to Marvin)
I am on my phone so
I am on my phone so I have not been able to research this for you. I think
you are right for the most part. Instead of multiple methods, python kind
of fakes overloading by being to have named function arguments which can
have default values, so you can call the method with a dynamic number of
Will - You can override a method in Python, but can you overload it?
http://stackoverflow.com/questions/10202938/how-do-i-use-method-overloading-in-python
> On Apr 30, 2016, at 6:23 AM, Will Stevens wrote:
>
> Here is a pretty good explanation.
>
>
Allow me to clarify. :-)
host.enableMaintenance(apiclient) is how I was invoking it. Just like a regular
instance method.
For some reason, it wanted to invoke the class method when I did that and was
complaining about the lack of a parameter.
That being the case, I switched my code to the
You are probably getting this error because you are trying to call:
Host.enableMaintenance(client)
Check my examples above for how to call it.
Sorry I am on my phone, so I am not very efficient with my phone and cant
civet you better details. :)
On Apr 30, 2016 8:23 AM, "Will Stevens"
Here is a pretty good explanation.
http://stackoverflow.com/questions/136097/what-is-the-difference-between-staticmethod-and-classmethod-in-python
I am guessing that both exist because the function is called both with a
host instance and with the class itself.
Class instance example:
Hi Mike,
classmethod's first argument is always its class as it is always bound to
the class, which is not the case with normal methods. Thus, both of the
above methods can in essence still co-exist in base.py as they serve
different purposes.
In the latter classmethod, you need to pass your
Hi everyone,
I received an error when trying to invoke the instance version of
enableMaintenance (below).
'TypeError: enableMaintenance() takes exactly 3 arguments (2 given)\n']
I looked at base.py and it has the following with regards to maintenance mode
for hosts:
def
20 matches
Mail list logo