@@ -128,7 +128,8 @@ async def __aexit__(self, type, value, traceback):
128128 await self .close_db ()
129129
130130 async def post_init (self ):
131- await self .get_dcs_branch_and_version ()
131+ if 'DCS' in self .locals :
132+ await self .get_dcs_branch_and_version ()
132133 self .pool , self .apool = await self .init_db ()
133134 try :
134135 self ._master = await self .heartbeat ()
@@ -229,11 +230,12 @@ def read_locals(self) -> dict:
229230 f"{ url .scheme } ://{ url .username } :SECRET@{ url .hostname } :{ port } { url .path } ?sslmode=prefer"
230231 dirty = True
231232 self .log .info ("Database password found, removing it from config." )
232- password = node ['DCS' ].pop ('dcs_password' , node ['DCS' ].pop ('password' , None ))
233- if password :
234- node ['DCS' ]['user' ] = node ['DCS' ].pop ('dcs_user' , node ['DCS' ].get ('user' ))
235- utils .set_password ('DCS' , password , self .config_dir )
236- dirty = True
233+ if 'DCS' in node :
234+ password = node ['DCS' ].pop ('dcs_password' , node ['DCS' ].pop ('password' , None ))
235+ if password :
236+ node ['DCS' ]['user' ] = node ['DCS' ].pop ('dcs_user' , node ['DCS' ].get ('user' ))
237+ utils .set_password ('DCS' , password , self .config_dir )
238+ dirty = True
237239 if dirty :
238240 with open (config_file , 'w' , encoding = 'utf-8' ) as f :
239241 yaml .dump (data , f )
@@ -613,18 +615,19 @@ async def register(self):
613615 if not self ._public_ip :
614616 self ._public_ip = await utils .get_public_ip ()
615617 self .log .info (f"- Public IP registered as: { self .public_ip } " )
616- if self .locals ['DCS' ].get ('autoupdate' , False ):
617- if not self .locals ['DCS' ].get ('cloud' , False ) or self .master :
618- self .autoupdate .start ()
619- else :
620- branch , old_version = await self .get_dcs_branch_and_version ()
621- try :
622- new_version = await self .get_latest_version (branch )
623- if new_version and old_version != new_version :
624- self .log .warning (
625- f"- Your DCS World version is outdated. Consider upgrading to version { new_version } ." )
626- except Exception :
627- self .log .warning ("Version check failed, possible auth-server outage." )
618+ if 'DCS' in self .locals :
619+ if self .locals ['DCS' ].get ('autoupdate' , False ):
620+ if not self .locals ['DCS' ].get ('cloud' , False ) or self .master :
621+ self .autoupdate .start ()
622+ else :
623+ branch , old_version = await self .get_dcs_branch_and_version ()
624+ try :
625+ new_version = await self .get_latest_version (branch )
626+ if new_version and old_version != new_version :
627+ self .log .warning (
628+ f"- Your DCS World version is outdated. Consider upgrading to version { new_version } ." )
629+ except Exception :
630+ self .log .warning ("Version check failed, possible auth-server outage." )
628631
629632 async def unregister (self ):
630633 async with self .apool .connection () as conn :
0 commit comments