Skip to content
GitLab
Explore
Projects
Groups
Snippets
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
M. Huang
Flexible Dataset Integrator
Commits
3d7375dd
Commit
3d7375dd
authored
10 months ago
by
M. Huang
Browse files
Options
Download
Email Patches
Plain Diff
typo, if no existence then register
parent
cff8041b
syncker
develop
2.8.3
2.8.2
2.8.1
2.8.0
2.7.2
2.7.1
2.7.0
2.6.2
2.6.1
2.6.0
2.5.3
2.5.2
2.5.1
2.5.0
ops-v1
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
fdi/_version.py
+4
-3
fdi/_version.py
fdi/pal/productstorage.py
+7
-9
fdi/pal/productstorage.py
fdi/pal/publicclientpool.py
+6
-2
fdi/pal/publicclientpool.py
fdi/pns/public_fdi_requests.py
+1
-1
fdi/pns/public_fdi_requests.py
with
18 additions
and
15 deletions
+18
-15
fdi/_version.py
+
4
-
3
View file @
3d7375dd
__version_info__
=
(
2
,
4
,
6
)
__version_info__
=
(
2
,
5
,
0
)
__version__
=
'.'
.
join
(
map
(
str
,
__version_info__
))
__revision__
=
'2.4.0.1-1-g07a0c44'
# more info if cannot save to pool
# typo, if no existence then register
# 2.4.6 more info if cannot save to pool
# 2.4.5 fix include
# 2.4.4 pool notexist
# 2.4.3 upload visible
...
...
@@ -31,7 +32,7 @@ __revision__ = '2.4.0.1-1-g07a0c44'
# 2.0.11 get cloudd_token
# 2.0.10 paho mqtt back to == 1.6.1 in setup.py
# 2.0.9 fix fragile error hadling of fdi_requests
# 2.0.8 add toPng debug code
# 2.0.8 add toP
rr
ng debug code
# 2.0.7 update tofits to image. paho reverted
# 2.0.6 shanghai
# 2.0.5 refactor iupload csdt prof defn code to main repo. get bin output ready in `toPng`
...
...
This diff is collapsed.
Click to expand it.
fdi/pal/productstorage.py
+
7
-
9
View file @
3d7375dd
...
...
@@ -90,7 +90,7 @@ class ProductStorage(object):
if
issubclass
(
pool
.
__class__
,
str
)
and
not
poolname
:
pool
,
poolname
=
poolname
,
pool
with
self
.
_locks
[
'w'
],
self
.
_locks
[
'r'
]:
if
pool
and
issubclass
(
pool
.
__class__
,
ProductPool
):
if
pool
is
not
None
and
issubclass
(
pool
.
__class__
,
ProductPool
):
_p
=
self
.
PM
.
getPool
(
pool
=
pool
,
read_only
=
read_only
,
**
kwds
)
from
fdi.pal.publicclientpool
import
PublicClientPool
if
issubclass
(
pool
.
__class__
,
PublicClientPool
):
...
...
@@ -98,7 +98,7 @@ class ProductStorage(object):
if
not
pe
:
if
not
makenew
:
raise
ServerError
(
f
"CSDB
{
pool
.
poolurl
}
is made but does not exist on the server."
+
\
f
"CSDB
{
pool
.
poolurl
}
is made but does not exist on the server."
+
\
(
", no makenew. Please make it with `ProductStorage`."
if
makenew
else
"."
))
...
...
@@ -223,16 +223,14 @@ class ProductStorage(object):
raise
ValueError
(
'None is not a valid pool name in the `PoolManager`.'
)
elif
poolname
not
in
self
.
_pools
:
#self.register(poolname)
logger
.
warning
(
'$$$ NOT self registering '
+
poolname
)
logger
.
warning
(
'$$$ NOT
registered and
self registering '
+
poolname
)
if
logger
.
getEffectiveLevel
()
<=
logging
.
DEBUG
:
desc
=
[
x
.
description
[
-
6
:]
for
x
in
product
]
if
issubclass
(
product
.
__class__
,
list
)
else
product
.
description
[
-
6
:]
logger
.
debug
(
'saving product:'
+
lls
(
desc
,
300
)
+
' to pool '
+
str
(
poolname
)
+
' with tag '
+
str
(
tag
)
+
f
'
t
he writeable pool is
{
wp
.
poolurl
}
, which
{
"exists"
if
wp
.
poolExists
()
else
"does not exist"
}
'
)
logger
.
debug
(
'saving product:'
+
lls
(
desc
,
300
)
+
\
' to pool '
+
str
(
poolname
)
+
' with tag '
+
\
str
(
tag
)
+
f
'
T
he writeable pool is
{
wp
.
poolurl
}
, which
{
"exists"
if
wp
.
poolExists
()
else
"does not exist"
}
'
)
If
not
wp
.
poolExists
():
self
.
register
(
poolname
=
poolname
,
pool
=
wp
,
make_new
=
True
)
try
:
ret
=
self
.
_pools
[
poolname
].
saveProduct
(
...
...
@@ -416,7 +414,7 @@ class ProductStorage(object):
---------
pool_or_urn : str, ProductPool
Can be a poolname, a pool object, or a URN.
If URN, returns product existence; if pool name or pool, returns that of the pool in storage.
"""
if
issubclass
(
pool_or_urn
.
__class__
,
str
):
if
pool_or_urn
.
startswith
(
'urn:'
):
...
...
This diff is collapsed.
Click to expand it.
fdi/pal/publicclientpool.py
+
6
-
2
View file @
3d7375dd
...
...
@@ -178,9 +178,13 @@ def getToken(poolurl, client, user_urlbase=None, verify=False, two_tries= False)
if
not
tokenMsg2
:
logger
.
error
(
f
'Cannot get token 2nd try from:
{
poolurl
}
at
{
user_urlbase
}
getting msg:
{
tokenMsg2
}
.'
)
return
''
token
=
tokenMsg2
[
'token'
]
else
:
try
:
token
=
tokenMsg2
[
'token'
]
except
KeyError
as
e
:
logger
.
error
(
f
'Did not get token 2 tries from:
{
poolurl
}
@
{
user_urlbase
}
getting msg:
{
tokenMsg2
}
.'
)
return
''
else
:
return
''
else
:
token
=
current_token
...
...
This diff is collapsed.
Click to expand it.
fdi/pns/public_fdi_requests.py
+
1
-
1
View file @
3d7375dd
...
...
@@ -580,7 +580,7 @@ def load_from_cloud(requestName, client=None, asyn=False, server_type='csdb', us
res
=
reqst
(
'post'
,
apis
,
data
=
data
,
headers
=
headers
,
server_type
=
server_type
,
auth
=
client
.
auth
,
**
kwds
)
else
:
logger
.
info
(
f
'upload
{
apis
}
,
{
files
}
,
{
data
}
,
{
headers
}
'
)
logger
.
info
(
f
'upload
apis:
{
apis
}
,
files:
{
lls
(
files
,
200
)
}
, data=
{
lls
(
data
,
200
)
}
, headers:
{
headers
}
auth=
{
client
.
auth
}
'
)
res
=
[]
for
a
,
f
,
d
,
h
in
zip
(
apis
,
files
,
data
,
headers
):
r
=
reqst
(
client
.
post
,
a
,
files
=
f
,
data
=
d
,
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment
Menu
Explore
Projects
Groups
Snippets