ryansb/ish — Issue #6: API calls still wrong
Author: agargiulo
Created: 2012-03-09 01:54:13+00:00
State: open

This issue still seems to be present.

``` python
>>> getattr(sys.interfaces[0].addresses[0],'class')
'netboot'
>>> setattr(sys.interfaces[0].addresses[0],'class','default')
>>> getattr(sys.interfaces[0].addresses[0],'class')
'default'
>>> sys.interfaces[0].addresses[0].put()
/usr/local/lib/python2.6/dist-packages/ish/resources/__init__.py:71: DeprecationWarning: BaseException.message has been deprecated as of Python 2.6
raise ImpulseDBError(e.message)
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python2.6/dist-packages/ish/resources/address.py", line 107, in put
self._conn.execute(query)
File "/usr/local/lib/python2.6/dist-packages/ish/resources/__init__.py", line 71, in execute
raise ImpulseDBError(e.message)
ImpulseDBError: Primary address for this interface and family already exists
CONTEXT: SQL statement "INSERT INTO "systems"."interface_addresses" ("mac","address","config","class","comment","last_modifier","isprimary") VALUES
(input_mac,input_address,input_config,input_class,input_comment,api.get_current_user(),input_isprimary)"
PL/pgSQL function "create_interface_address" line 24 at SQL statement
```

This interface already exists, therefore your shell should use the `"api"."modify_system"` not `"api"."create_system"`