[yocto] [yocto-autobuilder][PATCH] bin/release_scripts/release.py: Add some basic logging
Joshua G Lock
joshua.g.lock at linux.intel.com
Fri Jul 1 09:18:26 PDT 2016
On Wed, 2016-06-29 at 16:08 -0700, Graydon, Tracy wrote:
> This patch adds some basic logging to help find failure point should
> the script
> barf due to lost ssh session, etc. Without it, finding where to
> resume is not
> particularly entertaining.
>
> Signed-off-by: Graydon, Tracy <tracy.graydon at intel.com>
> ---
> bin/release_scripts/release.py | 43
> +++++++++++++++++++++++++++++++++++++++---
> 1 file changed, 40 insertions(+), 3 deletions(-)
>
> diff --git a/bin/release_scripts/release.py
> b/bin/release_scripts/release.py
> index 89f68be..b62b48c 100755
> --- a/bin/release_scripts/release.py
> +++ b/bin/release_scripts/release.py
> @@ -10,6 +10,7 @@ __maintainer__ = "Tracy Graydon"
> __email__ = "tracy.graydon at intel.com"
> '''
<snip>
> @@ -348,9 +355,18 @@ if __name__ == '__main__':
> os.system("clear")
> print
>
> + logfile = 'staging.log'
> + try:
> + os.remove(logfile)
> + except OSError:
> + pass
> +
> + logging.basicConfig(format='%(levelname)s:%(message)s',filename=
> logfile,level=logging.INFO)
> +
> VHOSTS = "/srv/www/vhosts"
> AB_BASE = os.path.join(VHOSTS,
> "autobuilder.yoctoproject.org/pub/releases")
> DL_DIR = os.path.join(VHOSTS,
> "downloads.yoctoproject.org/releases")
> + DL_BASE = os.path.join(DL_DIR, "/releases/yocto")
This will result in DL_BASE being /releases/yocto
You shouldn't include a path separator in any of the components after
the first. From the os.path.join() docs:
"If a component is an absolute path, all previous components are thrown
away and joining continues from the absolute path component."
i.e.
>>> import os
>>> os.path.join('/some', 'path', 'foo', 'bar')
'/some/path/foo/bar'
>>> os.path.join('/some', 'path', '/foo', 'bar')
'/foo/bar'
Cheers,
Joshua
More information about the yocto
mailing list