FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Redhat > Enterprise Watch List

 
 
LinkBack Thread Tools
 
Old 04-10-2012, 10:01 PM
"Brian C. Lane"
 
Default set PROXY environmental variables (#800388)

From: "Brian C. Lane" <bcl@redhat.com>

pre/post scripts can now use the following environmental variables:
PROXY or http_proxy
PROXY_USER
PROXY_PASSWORD

PROXY_USER and/or PROXY_PASSWORD may not be set, depending on the proxy
settings passed to anaconda.

Resolves: rhbz#800388
---
anaconda | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/anaconda b/anaconda
index b17d0e5..e5a226d 100755
--- a/anaconda
+++ b/anaconda
@@ -729,14 +729,22 @@ if __name__ == "__main__":
if opts.proxy:
anaconda.proxy = opts.proxy

+ # Set environmental variables to be used by pre/post scripts
+ log.debug("PROXY=%s", opts.proxy)
+ os.environ['PROXY'] = anaconda.proxy
+ # For wget/curl use
+ os.environ['http_proxy'] = anaconda.proxy
+
if opts.proxyAuth:
filename = opts.proxyAuth
ret = open(filename, "r").readlines()
os.unlink(filename)

anaconda.proxyUsername = ret[0].rstrip()
+ os.environ['PROXY_USER'] = anaconda.proxyUsername
if len(ret) == 2:
anaconda.proxyPassword = ret[1].rstrip()
+ os.environ['PROXY_PASSWORD'] = anaconda.proxyPassword

if opts.updateSrc:
anaconda.updateSrc = opts.updateSrc
--
1.7.7.6

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 04-11-2012, 12:22 AM
Jon Stanley
 
Default set PROXY environmental variables (#800388)

On Tue, Apr 10, 2012 at 6:01 PM, Brian C. Lane <bcl@redhat.com> wrote:

> pre/post scripts can now use the following environmental variables:
> PROXY or http_proxy
> PROXY_USER
> PROXY_PASSWORD

What about https and ftp_proxy variables? I think that it makes sense
to set the variable for whatever installation method the user has
configured in the kickstart file. Of course, there's really no way to
know anything else, and it'd be up to the user to somehow set that
themselves.

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 04-11-2012, 03:00 PM
Chris Lumens
 
Default set PROXY environmental variables (#800388)

> diff --git a/anaconda b/anaconda
> index b17d0e5..e5a226d 100755
> --- a/anaconda
> +++ b/anaconda
> @@ -729,14 +729,22 @@ if __name__ == "__main__":
> if opts.proxy:
> anaconda.proxy = opts.proxy
>
> + # Set environmental variables to be used by pre/post scripts
> + log.debug("PROXY=%s", opts.proxy)

I don't know that this needs to be logged.

> + os.environ['PROXY'] = anaconda.proxy
> + # For wget/curl use
> + os.environ['http_proxy'] = anaconda.proxy
> +
> if opts.proxyAuth:
> filename = opts.proxyAuth
> ret = open(filename, "r").readlines()
> os.unlink(filename)
>
> anaconda.proxyUsername = ret[0].rstrip()
> + os.environ['PROXY_USER'] = anaconda.proxyUsername
> if len(ret) == 2:
> anaconda.proxyPassword = ret[1].rstrip()
> + os.environ['PROXY_PASSWORD'] = anaconda.proxyPassword

Hm, is there a difference in environment variables that are defined but
empty, and ones that are not defined at all? If so, perhaps this is
going to trip something up.

- Chris

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 04-13-2012, 06:01 PM
"Brian C. Lane"
 
Default set PROXY environmental variables (#800388)

From: "Brian C. Lane" <bcl@redhat.com>

pre/post scripts can now use the following environmental variables:
PROXY
PROXY_USER
PROXY_PASSWORD

When no proxy user or password is set the _USER and/or _PASSWORD
variables will be set to a blank string.

Resolves: rhbz#800388
---
anaconda | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/anaconda b/anaconda
index b17d0e5..c2ebe76 100755
--- a/anaconda
+++ b/anaconda
@@ -738,6 +738,11 @@ if __name__ == "__main__":
if len(ret) == 2:
anaconda.proxyPassword = ret[1].rstrip()

+ # Set environmental variables to be used by pre/post scripts
+ os.environ["PROXY"] = anaconda.proxy
+ os.environ["PROXY_USER"] = anaconda.proxyUsername or ""
+ os.environ["PROXY_PASSWORD"] = anaconda.proxyPassword or ""
+
if opts.updateSrc:
anaconda.updateSrc = opts.updateSrc

--
1.7.7.6

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 
Old 04-13-2012, 06:03 PM
"Brian C. Lane"
 
Default set PROXY environmental variables (#800388)

On Fri, Apr 13, 2012 at 11:01:51AM -0700, Brian C. Lane wrote:
> From: "Brian C. Lane" <bcl@redhat.com>
>
> pre/post scripts can now use the following environmental variables:
> PROXY
> PROXY_USER
> PROXY_PASSWORD
>
> When no proxy user or password is set the _USER and/or _PASSWORD
> variables will be set to a blank string.
>
> Resolves: rhbz#800388
> ---
> anaconda | 5 +++++
> 1 files changed, 5 insertions(+), 0 deletions(-)
>
> diff --git a/anaconda b/anaconda
> index b17d0e5..c2ebe76 100755
> --- a/anaconda
> +++ b/anaconda
> @@ -738,6 +738,11 @@ if __name__ == "__main__":
> if len(ret) == 2:
> anaconda.proxyPassword = ret[1].rstrip()
>
> + # Set environmental variables to be used by pre/post scripts
> + os.environ["PROXY"] = anaconda.proxy
> + os.environ["PROXY_USER"] = anaconda.proxyUsername or ""
> + os.environ["PROXY_PASSWORD"] = anaconda.proxyPassword or ""
> +
> if opts.updateSrc:
> anaconda.updateSrc = opts.updateSrc
>
> --
> 1.7.7.6

I think we're better off limiting what we set and letting the pre/post
script pick them up and copy them to whatever their specific apps need.

--
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)
_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@redhat.com
https://www.redhat.com/mailman/listinfo/anaconda-devel-list
 

Thread Tools




All times are GMT. The time now is 07:35 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org