Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
steering
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
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
AURA
steering
Commits
bf602348
Commit
bf602348
authored
3 years ago
by
Ernesto Rico Schmidt
Browse files
Options
Downloads
Patches
Plain Diff
Remove check_automation_ids management command
parent
8350d681
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
program/management/commands/check_automation_ids.py
+0
-44
0 additions, 44 deletions
program/management/commands/check_automation_ids.py
with
0 additions
and
44 deletions
program/management/commands/check_automation_ids.py
deleted
100644 → 0
+
0
−
44
View file @
8350d681
import
json
from
os.path
import
join
from
django.conf
import
settings
from
django.core.management.base
import
NoArgsCommand
from
program.models
import
Schedule
class
Command
(
NoArgsCommand
):
help
=
'
checks the automation_ids used by program slots against the exported
'
def
handle_noargs
(
self
,
**
options
):
cache_dir
=
getattr
(
settings
,
'
AUTOMATION_CACHE_DIR
'
,
'
cache
'
)
cached_shows
=
join
(
cache_dir
,
'
shows.json
'
)
with
open
(
cached_shows
)
as
shows_json
:
shows
=
json
.
loads
(
shows_json
.
read
())
rd_ids
=
{}
for
show
in
shows
[
'
shows
'
]:
rd_ids
[
show
[
'
id
'
]]
=
show
for
show
in
shows
[
'
multi-shows
'
]:
rd_ids
[
show
[
'
id
'
]]
=
show
pv_ids
=
[]
for
schedule
in
Schedule
.
objects
.
filter
(
automation_id__isnull
=
False
):
pv_ids
.
append
(
int
(
schedule
.
automation_id
))
for
automation_id
in
sorted
(
rd_ids
.
iterkeys
()):
if
rd_ids
[
automation_id
][
'
type
'
]
==
'
s
'
:
continue
multi_id
=
-
1
if
'
multi
'
in
rd_ids
[
automation_id
]:
multi_id
=
rd_ids
[
automation_id
][
'
multi
'
][
'
id
'
]
if
automation_id
not
in
pv_ids
and
multi_id
not
in
pv_ids
:
if
multi_id
<
0
:
self
.
stdout
.
write
(
self
.
style
.
NOTICE
,
f
'
+
{
automation_id
}
'
)
else
:
self
.
stdout
.
write
(
self
.
style
.
NOTICE
,
f
'
+
{
automation_id
}
(
{
multi_id
}
)
'
)
for
automation_id
in
sorted
(
pv_ids
):
if
automation_id
not
in
rd_ids
:
self
.
stdout
.
write
(
self
.
style
.
NOTICE
,
f
'
-
{
automation_id
}
'
)
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