Move code extracting job ID into function
Move code extracting job ID into function

It might come in handy at some point and makes the code a bit easier
to read.

Reviewed-by: iustinp


leshchevds/ganeti,ganeti/ganeti,mbakke/ganeti,leshchevds/ganeti,andir/ganeti,apyrgio/snf-ganeti,onponomarev/ganeti,leshchevds/ganeti,apyrgio/snf-ganeti,dimara/ganeti,mbakke/ganeti,grnet/snf-ganeti,yiannist/ganeti,ganeti/ganeti,ganeti-github-testing/ganeti-test-1,onponomarev/ganeti,bitemyapp/ganeti,andir/ganeti,yiannist/ganeti,andir/ganeti,apyrgio/ganeti,ganeti-github-testing/ganeti-test-1,mbakke/ganeti,bitemyapp/ganeti,ganeti/ganeti,grnet/snf-ganeti,yiannist/ganeti,dimara/ganeti,apyrgio/ganeti