]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/dashboard: RGW is not working if an URL prefix is defined 23200/head
authorVolker Theile <vtheile@suse.com>
Tue, 24 Jul 2018 07:28:49 +0000 (09:28 +0200)
committerVolker Theile <vtheile@suse.com>
Wed, 25 Jul 2018 10:18:12 +0000 (12:18 +0200)
Fixes https://tracker.ceph.com/issues/25068

Signed-off-by: Volker Theile <vtheile@suse.com>
src/pybind/mgr/dashboard/frontend/src/app/shared/api/rgw-bucket.service.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/api/rgw-bucket.service.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/api/rgw-user.service.spec.ts
src/pybind/mgr/dashboard/frontend/src/app/shared/api/rgw-user.service.ts

index a57b1be688dba3f87eff8b7d6a9393a6147ee82c..b210757d2742c3f2e1b92288de3f5340fb921b09 100644 (file)
@@ -31,7 +31,7 @@ describe('RgwBucketService', () => {
     service.list().subscribe((resp) => {
       result = resp;
     });
-    const req = httpTesting.expectOne('/api/rgw/bucket');
+    const req = httpTesting.expectOne('api/rgw/bucket');
     req.flush([]);
     expect(req.request.method).toBe('GET');
     expect(result).toEqual([]);
@@ -42,13 +42,13 @@ describe('RgwBucketService', () => {
     service.list().subscribe((resp) => {
       result = resp;
     });
-    let req = httpTesting.expectOne('/api/rgw/bucket');
+    let req = httpTesting.expectOne('api/rgw/bucket');
     req.flush(['foo', 'bar']);
 
-    req = httpTesting.expectOne('/api/rgw/bucket/foo');
+    req = httpTesting.expectOne('api/rgw/bucket/foo');
     req.flush({ name: 'foo' });
 
-    req = httpTesting.expectOne('/api/rgw/bucket/bar');
+    req = httpTesting.expectOne('api/rgw/bucket/bar');
     req.flush({ name: 'bar' });
 
     expect(req.request.method).toBe('GET');
@@ -57,31 +57,31 @@ describe('RgwBucketService', () => {
 
   it('should call get', () => {
     service.get('foo').subscribe();
-    const req = httpTesting.expectOne('/api/rgw/bucket/foo');
+    const req = httpTesting.expectOne('api/rgw/bucket/foo');
     expect(req.request.method).toBe('GET');
   });
 
   it('should call create', () => {
     service.create('foo', 'bar').subscribe();
-    const req = httpTesting.expectOne('/api/rgw/bucket?bucket=foo&uid=bar');
+    const req = httpTesting.expectOne('api/rgw/bucket?bucket=foo&uid=bar');
     expect(req.request.method).toBe('POST');
   });
 
   it('should call update', () => {
     service.update('foo', 'bar', 'baz').subscribe();
-    const req = httpTesting.expectOne('/api/rgw/bucket/foo?bucket_id=bar&uid=baz');
+    const req = httpTesting.expectOne('api/rgw/bucket/foo?bucket_id=bar&uid=baz');
     expect(req.request.method).toBe('PUT');
   });
 
   it('should call delete, with purgeObjects = true', () => {
     service.delete('foo').subscribe();
-    const req = httpTesting.expectOne('/api/rgw/bucket/foo?purge_objects=true');
+    const req = httpTesting.expectOne('api/rgw/bucket/foo?purge_objects=true');
     expect(req.request.method).toBe('DELETE');
   });
 
   it('should call delete, with purgeObjects = false', () => {
     service.delete('foo', false).subscribe();
-    const req = httpTesting.expectOne('/api/rgw/bucket/foo?purge_objects=false');
+    const req = httpTesting.expectOne('api/rgw/bucket/foo?purge_objects=false');
     expect(req.request.method).toBe('DELETE');
   });
 
@@ -90,7 +90,7 @@ describe('RgwBucketService', () => {
     service.exists('foo').subscribe((resp) => {
       result = resp;
     });
-    const req = httpTesting.expectOne('/api/rgw/bucket');
+    const req = httpTesting.expectOne('api/rgw/bucket');
     expect(req.request.method).toBe('GET');
     req.flush(['foo', 'bar']);
     expect(result).toBe(true);
index f1de82eda5a8338214136ff656a499f5ae30bd48..fdd94672dfa951020494cebdb192edc79563c084 100644 (file)
@@ -13,7 +13,7 @@ import { ApiModule } from './api.module';
   providedIn: ApiModule
 })
 export class RgwBucketService {
-  private url = '/api/rgw/bucket';
+  private url = 'api/rgw/bucket';
 
   constructor(private http: HttpClient) {}
 
index b9acad14d480255201f684204e6bfc70502381a6..060b79a54f4bb083dc7d49400889632cc39a68e3 100644 (file)
@@ -33,7 +33,7 @@ describe('RgwUserService', () => {
     service.list().subscribe((resp) => {
       result = resp;
     });
-    const req = httpTesting.expectOne('/api/rgw/user');
+    const req = httpTesting.expectOne('api/rgw/user');
     expect(req.request.method).toBe('GET');
     req.flush([]);
     expect(result).toEqual([]);
@@ -45,15 +45,15 @@ describe('RgwUserService', () => {
       result = resp;
     });
 
-    let req = httpTesting.expectOne('/api/rgw/user');
+    let req = httpTesting.expectOne('api/rgw/user');
     expect(req.request.method).toBe('GET');
     req.flush(['foo', 'bar']);
 
-    req = httpTesting.expectOne('/api/rgw/user/foo');
+    req = httpTesting.expectOne('api/rgw/user/foo');
     expect(req.request.method).toBe('GET');
     req.flush({ name: 'foo' });
 
-    req = httpTesting.expectOne('/api/rgw/user/bar');
+    req = httpTesting.expectOne('api/rgw/user/bar');
     expect(req.request.method).toBe('GET');
     req.flush({ name: 'bar' });
 
@@ -62,79 +62,79 @@ describe('RgwUserService', () => {
 
   it('should call enumerate', () => {
     service.enumerate().subscribe();
-    const req = httpTesting.expectOne('/api/rgw/user');
+    const req = httpTesting.expectOne('api/rgw/user');
     expect(req.request.method).toBe('GET');
   });
 
   it('should call get', () => {
     service.get('foo').subscribe();
-    const req = httpTesting.expectOne('/api/rgw/user/foo');
+    const req = httpTesting.expectOne('api/rgw/user/foo');
     expect(req.request.method).toBe('GET');
   });
 
   it('should call getQuota', () => {
     service.getQuota('foo').subscribe();
-    const req = httpTesting.expectOne('/api/rgw/user/foo/quota');
+    const req = httpTesting.expectOne('api/rgw/user/foo/quota');
     expect(req.request.method).toBe('GET');
   });
 
   it('should call update', () => {
     service.update('foo', { xxx: 'yyy' }).subscribe();
-    const req = httpTesting.expectOne('/api/rgw/user/foo?xxx=yyy');
+    const req = httpTesting.expectOne('api/rgw/user/foo?xxx=yyy');
     expect(req.request.method).toBe('PUT');
   });
 
   it('should call updateQuota', () => {
     service.updateQuota('foo', { xxx: 'yyy' }).subscribe();
-    const req = httpTesting.expectOne('/api/rgw/user/foo/quota?xxx=yyy');
+    const req = httpTesting.expectOne('api/rgw/user/foo/quota?xxx=yyy');
     expect(req.request.method).toBe('PUT');
   });
 
   it('should call create', () => {
     service.create({ foo: 'bar' }).subscribe();
-    const req = httpTesting.expectOne('/api/rgw/user?foo=bar');
+    const req = httpTesting.expectOne('api/rgw/user?foo=bar');
     expect(req.request.method).toBe('POST');
   });
 
   it('should call delete', () => {
     service.delete('foo').subscribe();
-    const req = httpTesting.expectOne('/api/rgw/user/foo');
+    const req = httpTesting.expectOne('api/rgw/user/foo');
     expect(req.request.method).toBe('DELETE');
   });
 
   it('should call createSubuser', () => {
     service.createSubuser('foo', { xxx: 'yyy' }).subscribe();
-    const req = httpTesting.expectOne('/api/rgw/user/foo/subuser?xxx=yyy');
+    const req = httpTesting.expectOne('api/rgw/user/foo/subuser?xxx=yyy');
     expect(req.request.method).toBe('POST');
   });
 
   it('should call deleteSubuser', () => {
     service.deleteSubuser('foo', 'bar').subscribe();
-    const req = httpTesting.expectOne('/api/rgw/user/foo/subuser/bar');
+    const req = httpTesting.expectOne('api/rgw/user/foo/subuser/bar');
     expect(req.request.method).toBe('DELETE');
   });
 
   it('should call addCapability', () => {
     service.addCapability('foo', 'bar', 'baz').subscribe();
-    const req = httpTesting.expectOne('/api/rgw/user/foo/capability?type=bar&perm=baz');
+    const req = httpTesting.expectOne('api/rgw/user/foo/capability?type=bar&perm=baz');
     expect(req.request.method).toBe('POST');
   });
 
   it('should call deleteCapability', () => {
     service.deleteCapability('foo', 'bar', 'baz').subscribe();
-    const req = httpTesting.expectOne('/api/rgw/user/foo/capability?type=bar&perm=baz');
+    const req = httpTesting.expectOne('api/rgw/user/foo/capability?type=bar&perm=baz');
     expect(req.request.method).toBe('DELETE');
   });
 
   it('should call addS3Key', () => {
     service.addS3Key('foo', { xxx: 'yyy' }).subscribe();
-    const req = httpTesting.expectOne('/api/rgw/user/foo/key?key_type=s3&xxx=yyy');
+    const req = httpTesting.expectOne('api/rgw/user/foo/key?key_type=s3&xxx=yyy');
     expect(req.request.method).toBe('POST');
   });
 
   it('should call deleteS3Key', () => {
     service.deleteS3Key('foo', 'bar').subscribe();
-    const req = httpTesting.expectOne('/api/rgw/user/foo/key?key_type=s3&access_key=bar');
+    const req = httpTesting.expectOne('api/rgw/user/foo/key?key_type=s3&access_key=bar');
     expect(req.request.method).toBe('DELETE');
   });
 
index a1563940737e8563401b31edd1bf2ad95566b65a..cc7b749a584b82ede68d2bfeb625fd28b3746aab 100644 (file)
@@ -13,7 +13,7 @@ import { ApiModule } from './api.module';
   providedIn: ApiModule
 })
 export class RgwUserService {
-  private url = '/api/rgw/user';
+  private url = 'api/rgw/user';
 
   constructor(private http: HttpClient) {}