Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
perxis-python
Manage
Activity
Members
Labels
Plan
Issues
3
Issue boards
Milestones
Wiki
Custom issue tracker
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
perxis
perxis-python
Commits
dca43310
Commit
dca43310
authored
9 months ago
by
Eterevskiy Georgiy
Browse files
Options
Downloads
Plain Diff
Merge branch 'feature/add-space-to-ext' into 'master'
Исправлена ошибка в методе uninstall See merge request
!71
parents
c8ffc5eb
05ad2398
No related branches found
Branches containing commit
Tags
v1.7.1
Tags containing commit
1 merge request
!71
Исправлена ошибка в методе uninstall
Pipeline
#57256
passed with stage
Stage:
in 31 seconds
Changes
2
Pipelines
1
Hide 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 @
dca43310
...
...
@@ -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
:
errors_list
.
append
(
f
"
Не удалось опубликовать действие
{
action_item
.
id
}
,
{
e
.
details
()
}
"
)
# Если 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 @
dca43310
...
...
@@ -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