And if it's necessary.. I think 
return nodedev_detach(name, options="", **datgs)
should be
return nodedev_detach(name, options=options, **datgs)