Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
T
tag-hierarchy-update
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
CI / CD Analytics
Repository Analytics
Value Stream Analytics
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Sabari T
tag-hierarchy-update
Commits
5044bbbf
Commit
5044bbbf
authored
Jun 21, 2021
by
Sabari T
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tag_hierarchy update script
parent
eb0bfb14
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
28 deletions
+8
-28
.idea/vcs.xml
.idea/vcs.xml
+0
-6
scripts/db/mongo/collections/tag_hierarchy.py
scripts/db/mongo/collections/tag_hierarchy.py
+0
-6
scripts/handler/update_handler.py
scripts/handler/update_handler.py
+8
-5
scripts/utils/mongo_util.py
scripts/utils/mongo_util.py
+0
-11
No files found.
.idea/vcs.xml
View file @
5044bbbf
<?xml version="1.0" encoding="UTF-8"?>
<?xml version="1.0" encoding="UTF-8"?>
<project
version=
"4"
>
<project
version=
"4"
>
<component
name=
"CommitMessageInspectionProfile"
>
<profile
version=
"1.0"
>
<inspection_tool
class=
"CommitFormat"
enabled=
"true"
level=
"WARNING"
enabled_by_default=
"true"
/>
<inspection_tool
class=
"CommitNamingConvention"
enabled=
"true"
level=
"WARNING"
enabled_by_default=
"true"
/>
</profile>
</component>
<component
name=
"VcsDirectoryMappings"
>
<component
name=
"VcsDirectoryMappings"
>
<mapping
directory=
"$PROJECT_DIR$"
vcs=
"Git"
/>
<mapping
directory=
"$PROJECT_DIR$"
vcs=
"Git"
/>
</component>
</component>
...
...
scripts/db/mongo/collections/tag_hierarchy.py
View file @
5044bbbf
...
@@ -150,9 +150,3 @@ class TagHierarchy(MongoCollectionBaseClass):
...
@@ -150,9 +150,3 @@ class TagHierarchy(MongoCollectionBaseClass):
"""
"""
return
self
.
delete_one
(
query
=
query
)
return
self
.
delete_one
(
query
=
query
)
def
drop_tag_hierarchy_collection
(
self
):
"""
The following function will delete whole tag_hierarchy collection
:return:
"""
return
self
.
drop
()
scripts/handler/update_handler.py
View file @
5044bbbf
...
@@ -20,16 +20,19 @@ class UpdateHandler:
...
@@ -20,16 +20,19 @@ class UpdateHandler:
temp_details
=
list
(
self
.
site_conf
.
find_site_by_aggregate
(
each_query
))
temp_details
=
list
(
self
.
site_conf
.
find_site_by_aggregate
(
each_query
))
details
.
extend
(
temp_details
)
details
.
extend
(
temp_details
)
logger
.
info
(
"Records fetched from following collection Successfully"
)
logger
.
info
(
"Records fetched from following collection Successfully"
)
logger
.
info
(
f
"
database_name: {self.site_conf.database} collection_name: {self.site_conf.collection}
"
)
logger
.
info
(
f
"
'database_name': '{self.site_conf.database}' 'collection_name': '{self.site_conf.collection}'
"
)
print
(
"Records Fetched Successfully"
)
print
(
"Records Fetched Successfully"
)
try
:
try
:
self
.
tag_hierarchy
.
drop_tag_hierarchy_collection
()
self
.
tag_hierarchy
.
delete_many_tag_hierarchy
({})
logger
.
info
(
f
"Dropped {self.tag_hierarchy.collection} collection from {self.site_conf.database} database"
)
logger
.
info
(
f
"Deleted all records from following collection"
)
logger
.
info
(
f
"'database_name': '{self.tag_hierarchy.database}' "
f
"'collection_name': '{self.tag_hierarchy.collection}'"
)
# for each_detail in details:
# for each_detail in details:
self
.
tag_hierarchy
.
insert_many_tag_hierarchy
(
details
)
self
.
tag_hierarchy
.
insert_many_tag_hierarchy
(
details
)
logger
.
info
(
"Updated the following collection Successfully"
)
logger
.
info
(
"Updated the following collection Successfully"
)
logger
.
info
(
logger
.
info
(
f
"'database_name': '{self.tag_hierarchy.database}' "
f
"database_name: {self.site_conf.database} collection_name: {self.tag_hierarchy.collection}
"
)
f
"'collection_name': '{self.tag_hierarchy.collection}'
"
)
print
(
"Updated the collection Successfully"
)
print
(
"Updated the collection Successfully"
)
except
Exception
as
e
:
except
Exception
as
e
:
logger
.
exception
(
str
(
e
))
logger
.
exception
(
str
(
e
))
...
...
scripts/utils/mongo_util.py
View file @
5044bbbf
...
@@ -214,17 +214,6 @@ class MongoCollectionBaseClass:
...
@@ -214,17 +214,6 @@ class MongoCollectionBaseClass:
except
Exception
:
except
Exception
:
raise
raise
def
drop
(
self
):
try
:
database_name
=
self
.
database
collection_name
=
self
.
collection
db
=
self
.
client
[
database_name
]
collection
=
db
[
collection_name
]
response
=
collection
.
drop
()
return
response
except
Exception
:
raise
def
find_count
(
self
,
json_data
,
database_name
,
collection_name
):
def
find_count
(
self
,
json_data
,
database_name
,
collection_name
):
"""
"""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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