Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
perxis-python
Manage
Activity
Members
Plan
Custom issue tracker
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package registry
Operate
Terraform modules
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
perxis
perxis-python
Commits
05ad2398
Commit
05ad2398
authored
11 months ago
by
Podosochnyy Maxim
Browse files
Options
Downloads
Patches
Plain Diff
Исправлена ошибка в методе uninstall
parent
1cb0795e
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
perxis/extensions/extension_setup.py
+19
-24
19 additions, 24 deletions
perxis/extensions/extension_setup.py
setup.py
+1
-1
1 addition, 1 deletion
setup.py
with
20 additions
and
25 deletions
perxis/extensions/extension_setup.py
+
19
−
24
View file @
05ad2398
...
...
@@ -15,7 +15,7 @@ from perxis.items import items_pb2_grpc, items_pb2
from
perxis.common
import
common_pb2
from
perxis.clients
import
clients_pb2_grpc
,
clients_pb2
from
perxis.environments
import
environments_pb2_grpc
,
environments_pb2
from
perxis.extensions.actions
import
make_action_item
,
make_action_struct
,
ACTIONS_COLLECTION_ID
from
perxis.extensions.actions
import
make_action_item
,
ACTIONS_COLLECTION_ID
logger
=
logging
.
getLogger
(
__name__
)
...
...
@@ -491,7 +491,7 @@ class ExtensionSetup:
action_item
=
make_action_item
(
space_id
,
env_id
,
action
)
try
:
r
=
await
self
.
items_service
.
Update
(
await
self
.
items_service
.
Update
(
items_pb2
.
UpdateRequest
(
item
=
items_pb2
.
Item
(
id
=
action_item
.
id
,
...
...
@@ -508,6 +508,10 @@ class ExtensionSetup:
continue
not_found
=
True
except
Exception
as
e
:
errors_list
.
append
(
f
"
Не удалось обновить действие
{
action_item
.
id
}
,
{
e
}
"
)
continue
if
not_found
:
try
:
...
...
@@ -518,6 +522,10 @@ class ExtensionSetup:
)
except
grpc
.
RpcError
as
e
:
errors_list
.
append
(
f
"
Не удалось создать действие
{
action_item
.
id
}
,
{
e
.
details
()
}
"
)
except
Exception
as
e
:
errors_list
.
append
(
f
"
Не удалось создать действие
{
action_item
.
id
}
,
{
e
}
"
)
continue
try
:
await
self
.
items_service
.
Publish
(
...
...
@@ -526,40 +534,26 @@ class ExtensionSetup:
)
)
except
grpc
.
RpcError
as
e
:
# Если action уже опубликован
if
"
item cannot be published in this state
"
not
in
e
.
details
():
errors_list
.
append
(
f
"
Не удалось опубликовать действие
{
action_item
.
id
}
,
{
e
.
details
()
}
"
)
except
Exception
as
e
:
errors_list
.
append
(
f
"
Не удалось опубликовать действие
{
action_item
.
id
}
,
{
e
}
"
)
return
errors_list
async
def
__remove_actions
(
self
,
space_id
:
str
,
env_id
:
str
)
->
list
[
str
]:
errors_list
=
[]
for
action
in
self
.
actions
:
action_item
=
make_action_item
(
space_id
,
env_id
,
action
)
try
:
await
self
.
items_service
.
Unpublish
(
items_pb2
.
UnpublishRequest
(
item
=
items_pb2
.
Item
(
id
=
action_item
.
id
,
space_id
=
action_item
.
space_id
,
env_id
=
action_item
.
env_id
,
collection_id
=
action_item
.
collection_id
,
)
)
)
except
grpc
.
RpcError
as
e
:
if
"
not found
"
not
in
e
.
details
():
errors_list
.
append
(
f
"
Не удалось снять с публикации действие
{
action
.
get
(
'
id
'
,
'
n/a
'
)
}
,
{
e
.
details
()
}
"
)
try
:
await
self
.
items_service
.
Delete
(
items_pb2
.
DeleteRequest
(
space_id
=
space_id
,
env_id
=
env_id
,
item
=
items_pb2
.
Item
(
id
=
action_item
.
id
,
space_id
=
action_item
.
space_id
,
env_id
=
action_item
.
env_id
,
space_id
=
space_id
,
env_id
=
env_id
,
collection_id
=
action_item
.
collection_id
,
),
options
=
items_pb2
.
DeleteOptions
(
...
...
@@ -572,6 +566,8 @@ class ExtensionSetup:
# Отсутствие действия это не ошибка
if
"
not found
"
not
in
e
.
details
():
errors_list
.
append
(
f
"
Не удалось удалить действие
{
action
.
get
(
'
id
'
,
'
n/a
'
)
}
,
{
e
.
details
()
}
"
)
except
Exception
as
e
:
errors_list
.
append
(
f
"
Не удалось удалить действие -
{
e
}
"
)
return
errors_list
...
...
@@ -605,7 +601,6 @@ class ExtensionSetup:
async
def
uninstall
(
self
,
space_id
:
str
,
env_id
:
str
,
use_remove
:
bool
)
->
list
[
str
]:
errors
=
[]
if
use_remove
:
errors
+=
await
self
.
__remove_collections
(
space_id
,
env_id
)
errors
+=
await
self
.
__remove_clients
(
space_id
)
...
...
This diff is collapsed.
Click to expand it.
setup.py
+
1
−
1
View file @
05ad2398
...
...
@@ -14,7 +14,7 @@ def load_requirements():
setup
(
name
=
'
perxis
'
,
version
=
'
1.7.
0
'
,
version
=
'
1.7.
1
'
,
description
=
'
Perxis python client
'
,
long_description
=
long_description
,
long_description_content_type
=
'
text/markdown
'
,
...
...
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