python26 compat changes, lack of context managers

resubmitting on branch pulp-2.2