Skip to content

Instantly share code, notes, and snippets.

@hpk42
Created July 9, 2015 08:31
Show Gist options
  • Select an option

  • Save hpk42/bc8a5b9e1fa11ace00f5 to your computer and use it in GitHub Desktop.

Select an option

Save hpk42/bc8a5b9e1fa11ace00f5 to your computer and use it in GitHub Desktop.
diff --git a/server/devpi_server/model.py b/server/devpi_server/model.py
--- a/server/devpi_server/model.py
+++ b/server/devpi_server/model.py
@@ -421,6 +421,10 @@ class PrivateStage(BaseStage):
def modify(self, index=None, **kw):
attrs = get_ixconfigattrs(self.xom.config.hook, self.ixconfig["type"])
+ if "type" in kw and kw["type"] not in ("mirror", "stage"):
+ raise InvalidIndexconfig(
+ ["invalid index type: %s" %(kw["type"],)])
+
diff = list(set(kw).difference(attrs))
if diff:
raise InvalidIndexconfig(
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment