Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
aliveNotifier
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
kpetersn
aliveNotifier
Commits
298016ab
Commit
298016ab
authored
10 years ago
by
kpetersn
Browse files
Options
Downloads
Patches
Plain Diff
Modified test.py to use curl instead of python for grabbing the xml. Seems to fix the problem.
parent
f00719f8
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test.py
+18
-1
18 additions, 1 deletion
test.py
with
18 additions
and
1 deletion
test.py
+
18
−
1
View file @
298016ab
...
@@ -6,6 +6,9 @@ import os
...
@@ -6,6 +6,9 @@ import os
alive_url
=
"
http://bcda.xray.aps.anl.gov/cgi-bin/alivexml.cgi
"
alive_url
=
"
http://bcda.xray.aps.anl.gov/cgi-bin/alivexml.cgi
"
#!os.setgid(104)
#!os.setegid(104)
# function for troubleshooting
# function for troubleshooting
def
get_xml
(
alive_url
):
def
get_xml
(
alive_url
):
# Get the xml file
# Get the xml file
...
@@ -22,6 +25,15 @@ def get_xml(alive_url):
...
@@ -22,6 +25,15 @@ def get_xml(alive_url):
f
.
close
()
f
.
close
()
return
xml_string
return
xml_string
def
curl_xml
(
alive_url
):
# Get the xml file
print
"
Curling URL
"
command
=
"
curl -s %s
"
%
alive_url
p
=
os
.
popen
(
command
,
'
r
'
)
xml_string
=
p
.
read
()
p
.
close
()
return
xml_string
def
open_xml
(
xml_string
):
def
open_xml
(
xml_string
):
try
:
try
:
root
=
ET
.
fromstring
(
xml_string
)
root
=
ET
.
fromstring
(
xml_string
)
...
@@ -35,9 +47,14 @@ def open_xml(xml_string):
...
@@ -35,9 +47,14 @@ def open_xml(xml_string):
return
retval
return
retval
def
xml_test
(
alive_url
):
def
xml_test
(
alive_url
):
xml_string
=
get_xml
(
alive_url
)
#!xml_string = get_xml(alive_url)
xml_string
=
curl_xml
(
alive_url
)
if
xml_string
!=
None
:
if
xml_string
!=
None
:
print
open_xml
(
xml_string
)
print
open_xml
(
xml_string
)
print
"
uid = %i, gid = %i
"
%
(
os
.
getuid
(),
os
.
getgid
())
print
"
uid = %i, gid = %i
"
%
(
os
.
getuid
(),
os
.
getgid
())
print
"
euid = %i, egid = %i
"
%
(
os
.
geteuid
(),
os
.
getegid
())
#!print
#!print os.system("env | sort")
#!print
xml_test
(
alive_url
)
xml_test
(
alive_url
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment