Use getattr properly in legacy shell

Fixes bug 1131703

Change-Id: If97f422af170c29785d2bf8884fafff979031e14
Merge "Use getattr properly in legacy shell"