From: Joshua G Lock <joshua.g.lock@linux.intel.com>
To: "Graydon, Tracy" <tracy.graydon@intel.com>, yocto@yoctoproject.org
Subject: Re: [yocto-autobuilder][PATCH] bin/release_scripts/release.py: Add some basic logging
Date: Fri, 01 Jul 2016 17:18:26 +0100 [thread overview]
Message-ID: <1467389906.30210.5.camel@linux.intel.com> (raw)
In-Reply-To: <1467241722-307-1-git-send-email-tracy.graydon@intel.com>
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@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@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
next prev parent reply other threads:[~2016-07-01 16:18 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-29 23:08 [yocto-autobuilder][PATCH] bin/release_scripts/release.py: Add some basic logging Graydon, Tracy
2016-07-01 16:18 ` Joshua G Lock [this message]
-- strict thread matches above, loose matches on Subject: below --
2016-06-29 22:58 Graydon, Tracy
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1467389906.30210.5.camel@linux.intel.com \
--to=joshua.g.lock@linux.intel.com \
--cc=tracy.graydon@intel.com \
--cc=yocto@yoctoproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.