Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
production
building-knowledge-centre
building-dao
Commits
122eeb17
Commit
122eeb17
authored
Oct 15, 2020
by
unknown
Browse files
pass registry and staging as separate args
parent
31bc2b82
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
4 deletions
+4
-4
building_dao/building_generic.py
building_dao/building_generic.py
+4
-2
building_dao/settings.py
building_dao/settings.py
+0
-2
No files found.
building_dao/building_generic.py
View file @
122eeb17
...
@@ -9,6 +9,8 @@ import requests
...
@@ -9,6 +9,8 @@ import requests
from
requests.exceptions
import
HTTPError
from
requests.exceptions
import
HTTPError
from
retrying
import
retry
from
retrying
import
retry
from
MaxIcsRegistry
import
MaxIcsRegistry
from
.settings
import
Settings
from
.settings
import
Settings
MAX_RETRIES
=
5
# max retries number
MAX_RETRIES
=
5
# max retries number
...
@@ -40,13 +42,13 @@ class BuildingGeneric:
...
@@ -40,13 +42,13 @@ class BuildingGeneric:
This way, a VersionConflictError pops whenever a conflicts of versions happens
This way, a VersionConflictError pops whenever a conflicts of versions happens
"""
"""
def
__init__
(
self
,
uid
:
str
=
None
,
**
kwargs
)
->
None
:
def
__init__
(
self
,
uid
:
str
=
None
,
staging
:
bool
=
False
,
registry
:
MaxIcsRegistry
=
None
,
**
kwargs
)
->
None
:
self
.
logger
=
logging
.
getLogger
(
self
.
__class__
.
__name__
)
self
.
logger
=
logging
.
getLogger
(
self
.
__class__
.
__name__
)
self
.
_uid
=
uid
self
.
_uid
=
uid
self
.
_building
=
None
self
.
_building
=
None
self
.
settings
=
Settings
(
**
kwargs
)
self
.
settings
=
Settings
(
staging
=
staging
,
registry
=
registry
,
**
kwargs
)
if
self
.
_uid
:
if
self
.
_uid
:
self
.
fetch
(
timeout
=
kwargs
.
get
(
"timeout"
,
None
))
self
.
fetch
(
timeout
=
kwargs
.
get
(
"timeout"
,
None
))
...
...
building_dao/settings.py
View file @
122eeb17
...
@@ -8,8 +8,6 @@ class Settings:
...
@@ -8,8 +8,6 @@ class Settings:
def
__init__
(
self
,
staging
:
bool
=
False
,
registry
=
None
,
**
kwargs
)
->
None
:
def
__init__
(
self
,
staging
:
bool
=
False
,
registry
=
None
,
**
kwargs
)
->
None
:
self
.
logger
=
logging
.
getLogger
(
self
.
__class__
.
__name__
)
self
.
logger
=
logging
.
getLogger
(
self
.
__class__
.
__name__
)
staging
=
kwargs
.
get
(
"staging"
,
False
)
registry
=
kwargs
.
get
(
"registry"
)
if
not
registry
:
if
not
registry
:
self
.
logger
.
warning
(
"Registry is not set when initializing Building. Calling registry..."
)
self
.
logger
.
warning
(
"Registry is not set when initializing Building. Calling registry..."
)
...
...
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