Handle missing read_command

This commit is contained in:
Douglas Clowes
2014-11-03 14:25:42 +11:00
parent 300e29fe00
commit 9adb5cb907

View File

@ -1283,7 +1283,10 @@ def put_group(MyDriver, MyGroup):
if fetch_func == 'none': if fetch_func == 'none':
fetch_func = 'getValue' fetch_func = 'getValue'
read_func = MyVar['read_function'] read_func = MyVar['read_function']
read_command = MyVar['read_command'] if 'read_command' in MyVar:
read_command = MyVar['read_command']
else:
read_command = ''
txt += [' hsetprop ${scobj_hpath}/%s read ${ns}::%s ${scobj_hpath} %s {%s}' % (nodename, fetch_func, read_func, read_command)] txt += [' hsetprop ${scobj_hpath}/%s read ${ns}::%s ${scobj_hpath} %s {%s}' % (nodename, fetch_func, read_func, read_command)]
txt += [' hsetprop ${scobj_hpath}/%s %s ${ns}::%s ${scobj_hpath}' % (nodename, read_func, read_func)] txt += [' hsetprop ${scobj_hpath}/%s %s ${ns}::%s ${scobj_hpath}' % (nodename, read_func, read_func)]
if MyVar['writeable'] > 0 or MyVar['driveable']: if MyVar['writeable'] > 0 or MyVar['driveable']: