Hello Zhou Zheng Sheng,

I'd like you to do a code review.  Please visit

    http://gerrit.ovirt.org/8190

to review the following change.

Change subject: schema: Fixup the code which handles command return values in 
process-schema
......................................................................

schema: Fixup the code which handles command return values in process-schema

Commit d4f8ff6 fixups command return values in schema, but not fixup
the corresponding code that handles these values in process-schema.

So fix it.

Change-Id: Ib74e6371711fed14c54621ba88ee03cbe9d081fc
Signed-off-by: Zhou Zheng Sheng <[email protected]>
Signed-off-by: ShaoHe Feng <[email protected]>
---
M vdsm_api/process-schema.py
1 file changed, 7 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/90/8190/1

diff --git a/vdsm_api/process-schema.py b/vdsm_api/process-schema.py
index 4124828..8ee18c4 100755
--- a/vdsm_api/process-schema.py
+++ b/vdsm_api/process-schema.py
@@ -97,7 +97,7 @@
 
     # Find the already processed symbol information
     symbol = find_symbol(symbols, name)
-    symbol.update({'name': name, 'info_data': {}, 'info_return': {},
+    symbol.update({'name': name, 'info_data': {}, 'info_return': '',
                    'xxx': []})
 
     # Pop a blank line
@@ -134,7 +134,7 @@
         elif line.startswith('Notes:'):
             mode = 'notes'
             symbol['notes'] = line[6:]
-        elif mode in ('info_data', 'info_return'):
+        elif mode == 'info_data':
             # Try to read a parameter or return value
             m = re.search('^\@(.*?):\s*(.*)', line)
             if m:
@@ -145,6 +145,8 @@
             else:
                 # Just append it to the last one we added
                 symbol[mode][last_arg] += ' ' + line
+        elif mode == 'info_return':
+            symbol[mode] = symbol[mode].strip() + ' ' + line
         else:
             raise ValueError("Line not valid: %s" % line)
 
@@ -262,10 +264,9 @@
 
     if 'command' in s and 'returns' in s:
         # Command return value(s)
-        names = strip_stars(s.get('returns', {}).keys())
-        types = filter_types(s.get('returns', {}).values())
-        details = [s['info_return'][n] for n in names]
-        attr_table('Returns', names, types, details)
+        types = filter_types(s['returns'])
+        details = s['info_return']
+        attr_table('Returns', [''], [types], [details])
 
     if 'notes' in s:
         f.write('Notes:\n<ul>\n')


--
To view, visit http://gerrit.ovirt.org/8190
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib74e6371711fed14c54621ba88ee03cbe9d081fc
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: ShaoHe Feng <[email protected]>
Gerrit-Reviewer: Zhou Zheng Sheng <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to