Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

arrangement 6: add deprecation warnings to conf.get_* #765

Merged
merged 1 commit into from
May 22, 2018

Conversation

mlangsdorf
Copy link
Contributor

A lot of conf arguments have been deprecated and moved to reactor_config_map.
Replace _get_value with get_deprecated and print a warning message for
all get
* functions in conf where the value is not in the accepted parameters
list for BuildRequestV2.

Signed-off-by: Mark Langsdorf mlangsdo@redhat.com

osbs/conf.py Outdated
return self._get_value("odcs_insecure", self.conf_section, "odcs_insecure",
default=False, is_bool_val=True)
return self._get_deprecated("odcs_insecure", self.conf_section, "odcs_insecure",
default=False, is_bool_val=True)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E127 continuation line over-indented for visual indent

osbs/conf.py Outdated

def get_odcs_openidc_secret(self):
return self._get_value("odcs_openidc_secret", self.conf_section, "odcs_openidc_secret")
return self._get_deprecated("odcs_openidc_secret", self.conf_section,
"odcs_openidc_secret")

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E127 continuation line over-indented for visual indent

osbs/conf.py Outdated
return self._get_value("pdc_insecure", self.conf_section, "pdc_insecure",
default=False, is_bool_val=True)
return self._get_deprecated("pdc_insecure", self.conf_section, "pdc_insecure",
default=False, is_bool_val=True)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

E127 continuation line over-indented for visual indent

osbs/conf.py Outdated
@@ -102,6 +102,12 @@ def get_value_from_conf():
else:
return value

def _get_deprecated(self, args_key, conf_section, conf_key, default=None, is_bool_val=False):
logger.warning("user configuration %s in section %s is ignored in arrangement %s",
args_key, conf_section, DEFAULT_ARRANGEMENT_VERSION)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens when the default is arrangement 7? Maybe mention that this is true for arrangement versions greater than or equal to REACTOR_CONFIG_ARRANGEMENT_VERSION?

osbs/conf.py Outdated

def get_username(self):
return self._get_value("username", self.conf_section, "username")
return self._get_deprecated("username", self.conf_section, "username")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is used for authenticating against OpenShift instance. It's still used by osbs-client when creating builds, if username/password auth is to be used.

osbs/conf.py Outdated

def get_password(self):
return self._get_value("password", self.conf_section, "password")
return self._get_deprecated("password", self.conf_section, "password")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is password for authenticating against OpenShift instance. It's still used by osbs-client when creating builds, if username/password auth is to be used.

osbs/conf.py Outdated

def get_client_cert(self):
return self._get_value("client_cert", self.conf_section, "client_cert")
return self._get_deprecated("client_cert", self.conf_section, "client_cert")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is cert for authenticating against OpenShift instance. It's still used by osbs-client when creating builds, if cert auth is to be used.

osbs/conf.py Outdated

def get_client_key(self):
return self._get_value("client_key", self.conf_section, "client_key")
return self._get_deprecated("client_key", self.conf_section, "client_key")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is key for authenticating against OpenShift instance. It's still used by osbs-client when creating builds, if cert auth is to be used.

osbs/conf.py Outdated

def get_build_imagestream(self):
return self._get_value("build_imagestream", self.conf_section, "build_imagestream")
return self._get_deprecated("build_imagestream", self.conf_section, "build_imagestream")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is used for creating builds, it must be in osbs-client.

osbs/conf.py Outdated

def get_build_from(self):
return self._get_value("build_from", self.conf_section, "build_from")
return self._get_deprecated("build_from", self.conf_section, "build_from")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is used for creating builds, it must be in osbs-client.


def get_client_config_secret(self):
return self._get_value("client_config_secret", self.conf_section,
"client_config_secret")
return self._get_deprecated("client_config_secret", self.conf_section,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We're still using this in arrangement 6. But it's now configured in reactor config map, so let's deprecate it here.

osbs/conf.py Outdated
@@ -529,25 +535,23 @@ def get_arrangement_version(self):
raise OsbsValidationException("Invalid arrangement_version: %s" % value)

def get_can_orchestrate(self):
return self._get_value("can_orchestrate", self.conf_section, "can_orchestrate",
default=False, is_bool_val=True)
return self._get_deprecated("can_orchestrate", self.conf_section, "can_orchestrate",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to know this before we can create the Build object in OpenShift. It shouldn't be deprecated.

if value:
return [x.strip() for x in value.split(',')]
else:
return []

def get_equal_labels(self):
equal_labels = []
equal_labels_str = self._get_value("equal_labels", self.conf_section,
"equal_labels")
equal_labels_str = self._get_deprecated("equal_labels", self.conf_section, "equal_labels")
if equal_labels_str:
# must be in correct format
# e.g. `name1:name2:name3, release1:release2, version1:version2`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't comment any further, but shouldn't get_platform_descriptors also be deprecated now?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I got platform_descriptors and node_selectors confused. Fixed along with all the others.

@lcarva
Copy link
Contributor

lcarva commented May 21, 2018

Not sure why the centos 6 build failed. Restarted it to make sure it's not one of those random failures.

@lcarva
Copy link
Contributor

lcarva commented May 21, 2018

Ok, some progress in figuring out what's happening in CentOS 6.
It turns out to be a know pip issue (pypa/setuptools#937).
The workaround? Re-install pip via get-pip.py script 😨

@twaugh
Copy link
Member

twaugh commented May 22, 2018

See #766 for CentOS 6 test fix.

A lot of conf arguments have been deprecated and moved to reactor_config_map.
Replace _get_value with _get_deprecated and print a warning message for
all get_* functions in conf where the value is not in the accepted parameters
list for BuildRequestV2.

Signed-off-by: Mark Langsdorf <mlangsdo@redhat.com>
@mlangsdorf mlangsdorf merged commit 6044d0d into containerbuildsystem:master May 22, 2018
@mlangsdorf
Copy link
Contributor Author

added to the release notes under "Improvements":

  • added warning messages when a deprecated config variable is used

@mlangsdorf mlangsdorf deleted the osbs5056 branch June 27, 2018 13:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants