[Nodeshot] Latest changes thanks to your feedback

Clauz clauz at ninux.org
Wed Nov 20 21:25:44 CET 2013


On 11/20/2013 06:22 PM, Nemesis wrote:
> Hi,
> 
> First of all, thankyou all for the feedback you are sending.
> 
> I've done most of thechanges that I needed to do after receiving your
> answers to my latest technical questions.
> This is surely the way to go, after receiving yourfeedback I feel much
> more secure, so please keep to do so!
> 
> And good news, hey Clauz, look at this code:
> 
> *>>> device = Device.objects.get(name='RM5PomeziaSNode')**
> *(0.015) SELECT "net_device"."id", "net_device"."added",
> "net_device"."updated", "net_device"."access_level",
> "net_device"."name", "net_device"."node_id", "net_
> device"."type", "net_device"."status", "net_device"."location",
> "net_device"."elev", "net_device"."os", "net_device"."os_version",
> "net_device"."first_seen", "
> net_device"."last_seen", "net_device"."description",
> "net_device"."notes", "net_device"."data", "net_device"."shortcuts" FROM
> "net_device" WHERE "net_device"."
> name" = 'RM5PomeziaSNode' ; args=('RM5PomeziaSNode',)
> *>>> device.connector.connect()**
> *True
> *>>> device.connector.get_os()**
> *('AirOS', 'XM.ar7240.v5.3.3.sdk.9634.111221.2238')
> *>>> device.connector.get_wireless_output_power()*
> 27
> *>>> device.connector.get_wireless_channel()**
> *'5765'
>>>> *device.connector.disconnect()*
> 
> I'm slowly getting the syntactic sugar I desire! And it's self
> explanatory! :)

Very sweet! :)

> It willbe super cool to have a connector_class that uses SNMP or any
> other lighter protocol instead of SSH.
> This would save us the need of having to call "connect()" and
> "disconnect()".

Perhaps you can connect on the __init__ of the connector object and
disconnect on __del__ ?

Clauz







More information about the Nodeshot mailing list