What you are doing is
This line is calling the function every time it get's to that statement.
You need to change it to the following,
if s == 'Yes':
While you can totally use a function in an if/else statement you need to have at the base level a comparative that actually gives something back to the if statement to compare,
In closing here is a solution to scratch your head over.
return ("shutting down") if s == 'y' else ("shutdown aborted") if s == 'n' else ("sorry")