Code review comment for lp:~ursinha/uci-engine/private-lp-mthood

Revision history for this message
Andy Doan (doanac) wrote :

> === modified file 'branch-source-builder/cupstream2distro/'

> +sys.path.append(os.path.join(os.path.dirname(__file__), '../ci-utils'))

I don't think we need sys.path.append stuff in our code anymore.

> === modified file 'branch-source-builder/cupstream2distro/'

> - cmd = ["dput", ppa,
> + cmd = ["dput", "-u", "-c", "/tmp/", ppa,
> "{}_{}_source.changes".format(source, version_for_source_file)]

I'm being a little over-protective, but as per: "/tmp/" - Seems
like we should either make a constant for that, or (and I don't know the
code structure/flow, have pass this value down to the function via

> === modified file 'branch-source-builder/cupstream2distro/'

> +PRIVATE_LAUNCHPAD = _cfg.get('private_launchpad', None)

This is beyond the scope of this MP, but a tip: We now have a
unit_config module: ci_utils.unit_config that was written to handle this
stuff for all our services.

> === modified file 'branch-source-builder/'

def get_launchpad_log(url):
> '''Retrieves the build log from launchpad (thanks to celso).'''
> if not url:
> return None
> - api_url = url.replace('/','/')
> - lp = launchpadmanager.get_launchpad()
> + api_url = launchpad.get_lp_api_url(api_version="devel")
> + lp = launchpad.lp_login()
> return lp._browser.get(api_url)

looks like the "url" parameter to this function is now ignored. Should
we remove it and refactor the caller of it?

> === added file ''

> +sys.path.insert(0, os.path.join(os.path.dirname(__file__), './ci-utils'))

again - don't think you need to alter sys.path anymore.

> +web_root =""

I don't understand the details well enough, but should this value come
from our unit_config rather than being hard-coded? Actually it looks
like might be setting this in the unit_config?

« Back to merge proposal