| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent d415cc0 commit 9dd410f
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -51,7 +51,7 @@ def get(self, id, lazy=False, **kwargs): | |||
| 51 | 51 | ||
| 52 | 52 | class GetWithoutIdMixin(object): | |
| 53 | 53 | @exc.on_http_error(exc.GitlabGetError) | |
| 54 | - def get(self, **kwargs): | ||
| 54 | + def get(self, id=None, **kwargs): | ||
| 55 | 55 | """Retrieve a single object. | |
| 56 | 56 | ||
| 57 | 57 | Args: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -83,7 +83,7 @@ def do_list(self): | |||
| 83 | 83 | ||
| 84 | 84 | def do_get(self): | |
| 85 | 85 | id = None | |
| 86 | - if gitlab.mixins.GetWithoutIdMixin not in inspect.getmro(self.cls): | ||
| 86 | + if gitlab.mixins.GetWithoutIdMixin not in inspect.getmro(self.mgr_cls): | ||
| 87 | 87 | id = self.args.pop(self.cls._id_attr) | |
| 88 | 88 | ||
| 89 | 89 | try: | |
@@ -99,7 +99,9 @@ def do_delete(self): | |||
| 99 | 99 | cli.die("Impossible to destroy object", e) | |
| 100 | 100 | ||
| 101 | 101 | def do_update(self): | |
| 102 | - id = self.args.pop(self.cls._id_attr) | ||
| 102 | + id = None | ||
| 103 | + if gitlab.mixins.GetWithoutIdMixin not in inspect.getmro(self.mgr_cls): | ||
| 104 | + id = self.args.pop(self.cls._id_attr) | ||
| 103 | 105 | try: | |
| 104 | 106 | return self.mgr.update(id, self.args) | |
| 105 | 107 | except Exception as e: | |
@@ -282,15 +284,18 @@ def display_dict(d, padding): | |||
| 282 | 284 | return | |
| 283 | 285 | ||
| 284 | 286 | # not a dict, we assume it's a RESTObject | |
| 285 | - id = getattr(obj, obj._id_attr, None) | ||
| 286 | - print('%s: %s' % (obj._id_attr, id)) | ||
| 287 | + if obj._id_attr: | ||
| 288 | + id = getattr(obj, obj._id_attr, None) | ||
| 289 | + print('%s: %s' % (obj._id_attr, id)) | ||
| 287 | 290 | attrs = obj.attributes | |
| 288 | - attrs.pop(obj._id_attr) | ||
| 291 | + if obj._id_attr: | ||
| 292 | + attrs.pop(obj._id_attr) | ||
| 289 | 293 | display_dict(attrs, padding) | |
| 290 | 294 | ||
| 291 | 295 | else: | |
| 292 | - id = getattr(obj, obj._id_attr) | ||
| 293 | - print('%s: %s' % (obj._id_attr.replace('_', '-'), id)) | ||
| 296 | + if obj._id_attr: | ||
| 297 | + id = getattr(obj, obj._id_attr) | ||
| 298 | + print('%s: %s' % (obj._id_attr.replace('_', '-'), id)) | ||
| 294 | 299 | if hasattr(obj, '_short_print_attr'): | |
| 295 | 300 | value = getattr(obj, obj._short_print_attr) | |
| 296 | 301 | print('%s: %s' % (obj._short_print_attr, value)) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -95,9 +95,18 @@ testcase "branch deletion" ' | |||
| 95 | 95 | ' | |
| 96 | 96 | ||
| 97 | 97 | testcase "project upload" ' | |
| 98 | - GITLAB project upload --id "$PROJECT_ID" --filename '$(basename $0)' --filepath '$0' | ||
| 98 | + GITLAB project upload --id "$PROJECT_ID" \ | ||
| 99 | + --filename '$(basename $0)' --filepath '$0' >/dev/null 2>&1 | ||
| 99 | 100 | ' | |
| 100 | 101 | ||
| 101 | 102 | testcase "project deletion" ' | |
| 102 | 103 | GITLAB project delete --id "$PROJECT_ID" | |
| 103 | 104 | ' | |
| 105 | + | ||
| 106 | + testcase "application settings get" ' | ||
| 107 | + GITLAB application-settings get >/dev/null 2>&1 | ||
| 108 | + ' | ||
| 109 | + | ||
| 110 | + testcase "application settings update" ' | ||
| 111 | + GITLAB application-settings update --signup-enabled false | ||
| 112 | + ' | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments