def execute_su_command(db, args): source = fishbase.get_credentials_file(username=args[0]) dest = fishbase.get_credentials_file() shutil.copyfile(source, dest) db = Fluidinfo(Credentials(filename=dest)) username = db.credentials.username file = args[0].decode(DEFAULT_ENCODING) extra = u'' if args[0] == username else (u' (file %s)' % file) db.Print(u'Credentials set to user %s%s.' % (username, extra))