Skip to content

Commit

Permalink
Ignore overprovisioning in metadata protocol (#1391)
Browse files Browse the repository at this point in the history
* Add method to indicate supports overprovisioning

* Ignore overprovisioning in metadata protocol
  • Loading branch information
adepue authored and narrieta committed Nov 9, 2018
1 parent 3c8084e commit df80d3b
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
4 changes: 4 additions & 0 deletions azurelinuxagent/common/protocol/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,10 @@ def _get_trans_cert(self):
content = fileutil.read_file(trans_crt_file)
return textutil.get_bytes_from_pem(content)

def supports_overprovisioning(self):
# Metadata protocol does not support overprovisioning
return False

def detect(self):
self.get_vminfo()
trans_prv_file = os.path.join(conf.get_lib_dir(),
Expand Down
3 changes: 3 additions & 0 deletions azurelinuxagent/common/protocol/restapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -358,3 +358,6 @@ def report_ext_status(self, ext_handler_name, ext_name, ext_status):

def report_event(self, event):
raise NotImplementedError()

def supports_overprovisioning(self):
return True
11 changes: 7 additions & 4 deletions azurelinuxagent/ga/exthandlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,10 +316,13 @@ def handle_ext_handlers(self, etag=None):
return

if conf.get_enable_overprovisioning():
artifacts_profile = self.protocol.get_artifacts_profile()
if artifacts_profile and artifacts_profile.is_on_hold():
logger.info("Extension handling is on hold")
return
if not self.protocol.supports_overprovisioning():
logger.verbose("Overprovisioning is enabled but protocol does not support it.")
else:
artifacts_profile = self.protocol.get_artifacts_profile()
if artifacts_profile and artifacts_profile.is_on_hold():
logger.info("Extension handling is on hold")
return

wait_until = datetime.datetime.utcnow() + datetime.timedelta(minutes=DEFAULT_EXT_TIMEOUT_MINUTES)
max_dep_level = max([handler.sort_key() for handler in self.ext_handlers.extHandlers])
Expand Down

0 comments on commit df80d3b

Please sign in to comment.