Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
GÉANT Service Orchestrator
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
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
GÉANT Orchestration and Automation Team
GAP
GÉANT Service Orchestrator
Commits
0e14a4d4
Commit
0e14a4d4
authored
1 year ago
by
Mohammad Torkashvand
Browse files
Options
Downloads
Patches
Plain Diff
regnerated the PartnerTable migration again
parent
bcea3135
No related branches found
No related tags found
1 merge request
!176
added partner model
Pipeline
#85930
failed
1 year ago
Stage: tox
Stage: documentation
Stage: sonarqube
Changes
4
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
example.csv
+0
-5
0 additions, 5 deletions
example.csv
gso/cli/imports.py
+2
-4
2 additions, 4 deletions
gso/cli/imports.py
gso/services/partners.py
+0
-4
0 additions, 4 deletions
gso/services/partners.py
test/fixtures.py
+2
-1
2 additions, 1 deletion
test/fixtures.py
with
4 additions
and
14 deletions
example.csv
deleted
100644 → 0
+
0
−
5
View file @
bcea3135
name,email,as_number,as_set,route_set,black_listed_as_sets,additional_routers,additional_bgp_speakers,partner_type,created_at
Partner A,partnera@example.com,AS1234,,,"AS100,AS200",,"Router1,Router2",NREN,2024-03-14
Partner B,partnerb@example.com,AS5678,,,"AS300,AS400",,"Router3,Router4",RE_PEER,2024-03-15
Partner C,partnerc@example.com,AS91011,,,"AS500,AS600",,"Router5,Router6",PUBLIC_PEER,2024-03-16
This diff is collapsed.
Click to expand it.
gso/cli/imports.py
+
2
−
4
View file @
0e14a4d4
...
...
@@ -212,7 +212,7 @@ def import_partners_from_csv(file_path: Path) -> list[dict]:
@app.command
()
def
import_partners
(
file_path
:
str
=
typer
.
Argument
(...,
help
=
"
Path to the CSV file containing partners
"
)):
def
import_partners
(
file_path
:
str
=
typer
.
Argument
(...,
help
=
"
Path to the CSV file containing partners
"
))
->
None
:
"""
Import partners from a CSV file into the database.
"""
typer
.
echo
(
f
"
Importing partners from
{
file_path
}
...
"
)
...
...
@@ -221,9 +221,7 @@ def import_partners(file_path: str = typer.Argument(..., help="Path to the CSV f
try
:
for
partner
in
partners
:
if
partner
.
get
(
"
created_at
"
):
partner
[
"
created_at
"
]
=
datetime
.
strptime
(
partner
[
"
created_at
"
],
"
%Y-%m-%d
"
).
replace
(
tzinfo
=
UTC
)
partner
[
"
created_at
"
]
=
datetime
.
strptime
(
partner
[
"
created_at
"
],
"
%Y-%m-%d
"
).
replace
(
tzinfo
=
UTC
)
new_partner
=
PartnerTable
(
**
partner
)
db
.
session
.
add
(
new_partner
)
...
...
This diff is collapsed.
Click to expand it.
gso/services/partners.py
+
0
−
4
View file @
0e14a4d4
...
...
@@ -49,8 +49,6 @@ def create_partner(
raise
finally
:
db
.
session
.
close
()
finally
:
db
.
session
.
close
()
def
delete_partner_by_name
(
name
:
str
)
->
None
:
...
...
@@ -67,5 +65,3 @@ def delete_partner_by_name(name: str) -> None:
raise
finally
:
db
.
session
.
close
()
finally
:
db
.
session
.
close
()
This diff is collapsed.
Click to expand it.
test/fixtures.py
+
2
−
1
View file @
0e14a4d4
...
...
@@ -258,7 +258,8 @@ def iptrunk_subscription_factory(iptrunk_side_subscription_factory, faker, geant
iptrunk_sides
=
iptrunk_sides
or
[
iptrunk_side_a
,
iptrunk_side_b
]
iptrunk_subscription
=
IptrunkInactive
.
from_product_id
(
product_id
,
customer_id
=
partner
[
"
partner_id
"
],
insync
=
True
)
product_id
,
customer_id
=
partner
[
"
partner_id
"
],
insync
=
True
)
iptrunk_subscription
.
iptrunk
.
geant_s_sid
=
geant_s_sid
iptrunk_subscription
.
iptrunk
.
iptrunk_description
=
iptrunk_description
iptrunk_subscription
.
iptrunk
.
iptrunk_type
=
iptrunk_type
...
...
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