git://git.onelab.eu
/
plcapi.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
guard RefreshPeer():sync() not to insert the same record twice.
[plcapi.git]
/
PLC
/
Methods
/
DeleteAddressType.py
diff --git
a/PLC/Methods/DeleteAddressType.py
b/PLC/Methods/DeleteAddressType.py
index
445469e
..
353509e
100644
(file)
--- a/
PLC/Methods/DeleteAddressType.py
+++ b/
PLC/Methods/DeleteAddressType.py
@@
-1,3
+1,4
@@
+# $Id$
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
from PLC.Faults import *
from PLC.Method import Method
from PLC.Parameter import Parameter, Mixed
@@
-21,12
+22,13
@@
class DeleteAddressType(Method):
returns = Parameter(int, '1 if successful')
returns = Parameter(int, '1 if successful')
+
def call(self, auth, address_type_id_or_name):
def call(self, auth, address_type_id_or_name):
- address_types = AddressTypes(self.api, [address_type_id_or_name])
.values()
+ address_types = AddressTypes(self.api, [address_type_id_or_name])
if not address_types:
raise PLCInvalidArgument, "No such address type"
address_type = address_types[0]
if not address_types:
raise PLCInvalidArgument, "No such address type"
address_type = address_types[0]
-
address_type.delete()
address_type.delete()
+ self.event_objects = {'AddressType': [address_type['address_type_id']]}
return 1
return 1