Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
ZODB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Nicolas Wavrant
ZODB
Commits
cb226b80
Commit
cb226b80
authored
Jan 30, 2002
by
Jeremy Hylton
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Be careful to exit with non-zero status for any exception.
Remove useless -d option.
parent
f4390e8f
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
12 deletions
+21
-12
src/scripts/zeoup.py
src/scripts/zeoup.py
+21
-12
No files found.
src/scripts/zeoup.py
View file @
cb226b80
...
@@ -14,33 +14,35 @@ Options:
...
@@ -14,33 +14,35 @@ Options:
You must specify either -p and -h or -U.
You must specify either -p and -h or -U.
"""
"""
import
getopt
import
socket
import
sys
import
ZODB
from
ZEO.ClientStorage
import
ClientStorage
from
ZEO.ClientStorage
import
ClientStorage
def
main
(
addr
,
storage
,
days
):
def
check_server
(
addr
,
storage
):
cs
=
ClientStorage
(
addr
,
storage
=
storage
,
wait_for_server_on_startup
=
1
)
cs
=
ClientStorage
(
addr
,
storage
=
storage
,
wait_for_server_on_startup
=
0
)
# _startup() is an artifact of the way ZEO 1.0 works. The
# _startup() is an artifact of the way ZEO 1.0 works. The
# ClientStorage doesn't get fully initialized until registerDB()
# ClientStorage doesn't get fully initialized until registerDB()
# is called. The only thing we care about, though, is that
# is called. The only thing we care about, though, is that
# registerDB() calls _startup().
# registerDB() calls _startup().
cs
.
_startup
()
db
=
ZODB
.
DB
(
cs
)
db
.
close
()
def
usage
(
exit
=
1
):
def
usage
(
exit
=
1
):
print
__doc__
print
__doc__
print
" "
.
join
(
sys
.
argv
)
print
" "
.
join
(
sys
.
argv
)
sys
.
exit
(
exit
)
sys
.
exit
(
exit
)
if
__name__
==
"__main__"
:
def
main
():
import
getopt
import
socket
import
sys
host
=
None
host
=
None
port
=
None
port
=
None
unix
=
None
unix
=
None
storage
=
'1'
storage
=
'1'
days
=
0
try
:
try
:
opts
,
args
=
getopt
.
getopt
(
sys
.
argv
[
1
:],
'p:h:U:S:
d:
'
)
opts
,
args
=
getopt
.
getopt
(
sys
.
argv
[
1
:],
'p:h:U:S:'
)
for
o
,
a
in
opts
:
for
o
,
a
in
opts
:
if
o
==
'-p'
:
if
o
==
'-p'
:
port
=
int
(
a
)
port
=
int
(
a
)
...
@@ -63,4 +65,11 @@ if __name__ == "__main__":
...
@@ -63,4 +65,11 @@ if __name__ == "__main__":
usage
()
usage
()
addr
=
host
,
port
addr
=
host
,
port
main
(
addr
,
storage
,
days
)
check_server
(
addr
,
storage
)
if
__name__
==
"__main__"
:
try
:
main
()
except
Exception
,
err
:
print
err
sys
.
exit
(
1
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment